diff options
author | Karroffel <therzog@mail.de> | 2017-04-24 00:29:17 +0200 |
---|---|---|
committer | Karroffel <therzog@mail.de> | 2017-04-24 01:49:40 +0200 |
commit | 885239fb09da503472bb4def4754036e70b43f1a (patch) | |
tree | 25873e2975e6f2723145b5b0ce3f0f969a9e3ac2 /modules/gdscript/gd_script.cpp | |
parent | b474646de081084dd691648f87d6057b77fbd819 (diff) | |
download | redot-engine-885239fb09da503472bb4def4754036e70b43f1a.tar.gz |
re-added MultiScript
The very first Godot version (when it was open sourced) had "MultiScript" which lets you use multiple scripts on one object.
With the addition of mulitple new scripting languages (VisualScript, soon C# and GDNative) it can be of use to combine scripts rather than delegating (with huge maintainance cost) or creating child nodes
which could impact performance.
I used the code from 0b806ee as the base and made it work with the current master.
Diffstat (limited to 'modules/gdscript/gd_script.cpp')
-rw-r--r-- | modules/gdscript/gd_script.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 2367f60740..fe20a842cf 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -1696,9 +1696,9 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so //same thing for placeholders #ifdef TOOLS_ENABLED - while (E->get()->placeholders.size()) { + for (Set<PlaceHolderScriptInstance *>::Element *P = E->get()->placeholders.front(); P; P = P->next()) { - Object *obj = E->get()->placeholders.front()->get()->get_owner(); + Object *obj = P->get()->get_owner(); //save instance info List<Pair<StringName, Variant> > state; if (obj->get_script_instance()) { |