Merge pull request #28944 from Faless/mix/object_get_indexed

Fix Object::get_indexed for simple properties.
This commit is contained in:
Max Hilbrunner 2019-05-17 00:48:39 +02:00 committed by GitHub
commit 2809d86156
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 7 deletions

View File

@ -608,18 +608,16 @@ Variant Object::get_indexed(const Vector<StringName> &p_names, bool *r_valid) co
}
bool valid = false;
Variant current_value = get(p_names[0]);
Variant current_value = get(p_names[0], &valid);
for (int i = 1; i < p_names.size(); i++) {
current_value = current_value.get_named(p_names[i], &valid);
if (!valid) {
if (r_valid)
*r_valid = false;
return Variant();
}
if (!valid)
break;
}
if (r_valid)
*r_valid = true;
*r_valid = valid;
return current_value;
}