diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-05-16 23:22:52 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2019-05-16 23:22:52 +0200 |
commit | d39ffc101bd9592341530e5bc5436ddab1cd8f99 (patch) | |
tree | 89d6f8a53c11ba4502251cff1cde1ff70e039bad /core/object.cpp | |
parent | eded8d52e3f11357451214ab4d957ed1f7a31b18 (diff) | |
download | redot-engine-d39ffc101bd9592341530e5bc5436ddab1cd8f99.tar.gz |
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.
Diffstat (limited to 'core/object.cpp')
-rw-r--r-- | core/object.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/core/object.cpp b/core/object.cpp index 937aa3c745..2a4ab93a6d 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -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; } |