summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarroffel <therzog@mail.de>2017-04-10 04:30:08 +0200
committerKarroffel <therzog@mail.de>2017-04-10 04:30:08 +0200
commit0486645c39c471e8844520b70c25956a7a2f40c5 (patch)
tree4064908c7532e79b750e24cc827ba786ce7b6cb9
parentc7f8b22ba07c27ceb91307a178ee7520677018e1 (diff)
[GDNative] Didn't iterate over all scripts
-rw-r--r--modules/gdnative/gdnative.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index 43b309ae36..f646060d49 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -1167,27 +1167,25 @@ void GDNativeReloadNode::_notification(int p_what) {
// update placeholders (if any)
- GDNativeScript *script = NULL;
+ Set<GDNativeScript *> scripts;
for (Set<GDNativeScript *>::Element *S = GDNativeScriptLanguage::get_singleton()->script_list.front(); S; S = S->next()) {
if (lib->native_library->scripts.has(S->get()->get_script_name())) {
- script = S->get();
+ GDNativeScript *script = S->get();
script->script_data = lib->get_script_data(script->get_script_name());
- break;
+ scripts.insert(script);
}
}
- if (script == NULL) {
- // new class, cool. Nothing to do here
- continue;
- }
-
- if (script->placeholders.size() == 0)
- continue;
+ for (Set<GDNativeScript *>::Element *S = scripts.front(); S; S = S->next()) {
+ GDNativeScript *script = S->get();
+ if (script->placeholders.size() == 0)
+ continue;
- for (Set<PlaceHolderScriptInstance *>::Element *P = script->placeholders.front(); P; P = P->next()) {
- PlaceHolderScriptInstance *p = P->get();
- script->_update_placeholder(p);
+ for (Set<PlaceHolderScriptInstance *>::Element *P = script->placeholders.front(); P; P = P->next()) {
+ PlaceHolderScriptInstance *p = P->get();
+ script->_update_placeholder(p);
+ }
}
}