summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaguar <killerjaguar26@gmail.com>2015-06-13 14:10:06 -0400
committerJaguar <killerjaguar26@gmail.com>2015-06-13 14:10:06 -0400
commit7c0051beac315ad9c8896064d24ae362f5a65f7f (patch)
tree29d3529b1ee5eaab182f715bbf9fab7259ee9373
parent4e46143499be0e40ae29eff550cbeec4ebde3d85 (diff)
Fixed variables being set before calling the setter method
-rw-r--r--modules/gdscript/gd_script.cpp3
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;
}
}