diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-11-15 10:41:31 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-11-15 10:41:31 -0300 |
commit | a5c3e3084a33159418a7c709da8937161a209340 (patch) | |
tree | 7b9629db1b9f239837124f08257432c9c7febad1 /modules/gdscript | |
parent | 6277e6d40a0f0e8c84470482400959fca4ff5ad8 (diff) |
When script changes, defer tree updating. Fixes #9704
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gd_script.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index ba0353ae4a..e5d834c9e7 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -1599,17 +1599,18 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so Object *obj = E->get()->placeholders.front()->get()->get_owner(); //save instance info - List<Pair<StringName, Variant> > state; if (obj->get_script_instance()) { + map.insert(obj->get_instance_id(), List<Pair<StringName, Variant> >()); + List<Pair<StringName, Variant> > &state = map[obj->get_instance_id()]; obj->get_script_instance()->get_property_state(state); - map[obj->get_instance_id()] = state; obj->set_script(RefPtr()); } else { // no instance found. Let's remove it so we don't loop forever E->get()->placeholders.erase(E->get()->placeholders.front()->get()); } } + #endif for (Map<ObjectID, List<Pair<StringName, Variant> > >::Element *F = E->get()->pending_reload_state.front(); F; F = F->next()) { |