Browse Source

Merge pull request #51453 from Blackiris/fix-new-inherited-script

Fix infinite loop when creating a newly inherited GDScript file
Rémi Verschelde 4 years ago
parent
commit
c68b109f27
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/gdscript/gdscript_compiler.cpp

+ 1 - 1
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) {