1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Merge pull request #8339 from karroffel/gdnative-reload-fix

[GDNative] Didn't iterate over all scripts
This commit is contained in:
Rémi Verschelde
2017-04-10 08:53:49 +02:00
committed by GitHub

View File

@@ -1167,21 +1167,18 @@ void GDNativeReloadNode::_notification(int p_what) {
// update placeholders (if any) // 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()) { 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())) { 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()); script->script_data = lib->get_script_data(script->get_script_name());
break; scripts.insert(script);
} }
} }
if (script == NULL) { for (Set<GDNativeScript *>::Element *S = scripts.front(); S; S = S->next()) {
// new class, cool. Nothing to do here GDNativeScript *script = S->get();
continue;
}
if (script->placeholders.size() == 0) if (script->placeholders.size() == 0)
continue; continue;
@@ -1190,6 +1187,7 @@ void GDNativeReloadNode::_notification(int p_what) {
script->_update_placeholder(p); script->_update_placeholder(p);
} }
} }
}
} break; } break;
default: { default: {