summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_compiler.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-08-10 00:38:16 +0200
committerGitHub <noreply@github.com>2021-08-10 00:38:16 +0200
commitc68b109f270a2bf1c42c3f083b53e7bc26dadfd6 (patch)
tree3ace954f1dfd06afb83b1ffdd2a6d34ab9f8e862 /modules/gdscript/gdscript_compiler.cpp
parent2de5d2361ac39e61c610d6fc0f161a1237ae2815 (diff)
parent51b7179b5ad9f513ea978b6c8914a57b1841d2e2 (diff)
downloadredot-engine-c68b109f270a2bf1c42c3f083b53e7bc26dadfd6.tar.gz
Merge pull request #51453 from Blackiris/fix-new-inherited-script
Fix infinite loop when creating a newly inherited GDScript file
Diffstat (limited to 'modules/gdscript/gdscript_compiler.cpp')
-rw-r--r--modules/gdscript/gdscript_compiler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index 7c9d08b782..fe827a5b72 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -107,7 +107,7 @@ GDScriptDataType GDScriptCompiler::_gdtype_from_datatype(const GDScriptParser::D
// Locate class by constructing the path to it and following that path
GDScriptParser::ClassNode *class_type = p_datatype.class_type;
if (class_type) {
- if (class_type->fqcn.begins_with(main_script->path) || (!main_script->name.is_empty() && class_type->fqcn.begins_with(main_script->name))) {
+ if ((!main_script->path.is_empty() && class_type->fqcn.begins_with(main_script->path)) || (!main_script->name.is_empty() && class_type->fqcn.begins_with(main_script->name))) {
// Local class.
List<StringName> names;
while (class_type->outer) {