summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-25 15:44:28 +0200
committerGitHub <noreply@github.com>2021-07-25 15:44:28 +0200
commite2ebc7db58c0bd61504c592f9760aaf1389af0b9 (patch)
tree6b0637ccb6037e8444058a231c1931b33df5a605 /modules
parent738205d923647ea175e6d7684d26d505c9446547 (diff)
parent6938dd72f23c7c2b2f183deb98fd7b43a456c827 (diff)
Merge pull request #50841 from Blackiris/fix-instantiate-line-class
Fix instantiate line class
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript.cpp8
1 files 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<StringName> 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<GDScriptNativeClass> nc = memnew(GDScriptNativeClass(n));
- _add_global(n, nc);
+ _add_global(s, nc);
}
//populate singletons