Fix Object::get_indexed for simple properties.
Object::get_indexed was not correctly reporting invalid keys if the name was a direct property (not a subproperty), causing for example Tween to not report correctly a bad interpolate_property key.
This commit is contained in:
parent
eded8d52e3
commit
d39ffc101b
|
@ -608,18 +608,16 @@ Variant Object::get_indexed(const Vector<StringName> &p_names, bool *r_valid) co
|
||||||
}
|
}
|
||||||
bool valid = false;
|
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++) {
|
for (int i = 1; i < p_names.size(); i++) {
|
||||||
current_value = current_value.get_named(p_names[i], &valid);
|
current_value = current_value.get_named(p_names[i], &valid);
|
||||||
|
|
||||||
if (!valid) {
|
if (!valid)
|
||||||
if (r_valid)
|
break;
|
||||||
*r_valid = false;
|
|
||||||
return Variant();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (r_valid)
|
if (r_valid)
|
||||||
*r_valid = true;
|
*r_valid = valid;
|
||||||
|
|
||||||
return current_value;
|
return current_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue