diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-06-22 23:55:55 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-06-22 23:55:55 -0300 |
commit | 68443a649de93790190e02c59b17f973d3e42e7d (patch) | |
tree | 828bcb14fdd3e7d702198ab7962e4d14a8b6bf71 | |
parent | 74081cdaaa74882928464120500b3243f3255daf (diff) | |
parent | 7c0051beac315ad9c8896064d24ae362f5a65f7f (diff) |
Merge pull request #2088 from KillerJaguar/setter-fix
Fixed variables being set before calling the setter method
-rw-r--r-- | modules/gdscript/gd_script.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index ceca1ff2b9..70a5fd985c 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -2131,7 +2131,6 @@ bool GDInstance::set(const StringName& p_name, const Variant& p_value) { { const Map<StringName,GDScript::MemberInfo>::Element *E = script->member_indices.find(p_name); if (E) { - members[E->get().index]=p_value; if (E->get().setter) { const Variant *val=&p_value; Variant::CallError err; @@ -2140,6 +2139,8 @@ bool GDInstance::set(const StringName& p_name, const Variant& p_value) { return true; //function exists, call was successful } } + else + members[E->get().index] = p_value; return true; } } |