From 6938dd72f23c7c2b2f183deb98fd7b43a456c827 Mon Sep 17 00:00:00 2001 From: Julien Nguyen Date: Sun, 25 Jul 2021 14:04:57 +0200 Subject: Fix instantiate line class --- modules/gdscript/gdscript.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index b3975fa95c..bcb53508ea 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1643,17 +1643,17 @@ void GDScriptLanguage::init() { List class_list; ClassDB::get_class_list(&class_list); - for (StringName &n : class_list) { + for (const StringName &n : class_list) { String s = String(n); if (s.begins_with("_")) { - n = s.substr(1, s.length()); + s = s.substr(1, s.length()); } - if (globals.has(n)) { + if (globals.has(s)) { continue; } Ref nc = memnew(GDScriptNativeClass(n)); - _add_global(n, nc); + _add_global(s, nc); } //populate singletons -- cgit v1.2.3