You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Fixed variables being set before calling the setter method
This commit is contained in:
@@ -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);
|
const Map<StringName,GDScript::MemberInfo>::Element *E = script->member_indices.find(p_name);
|
||||||
if (E) {
|
if (E) {
|
||||||
members[E->get().index]=p_value;
|
|
||||||
if (E->get().setter) {
|
if (E->get().setter) {
|
||||||
const Variant *val=&p_value;
|
const Variant *val=&p_value;
|
||||||
Variant::CallError err;
|
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
|
return true; //function exists, call was successful
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
members[E->get().index] = p_value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user