From 110c4d40674fd338759f0e7655ac940b1c028809 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Tue, 9 Jul 2024 16:16:45 +0300 Subject: [PATCH] GDScript: Fix "Mismatched external parser" for autoloads --- core/config/project_settings.cpp | 4 ++-- modules/gdscript/gdscript_parser.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index eac1a66be70e..e59f79fcc807 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -329,9 +329,9 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) { String path = p_value; if (path.begins_with("*")) { autoload.is_singleton = true; - autoload.path = path.substr(1); + autoload.path = path.substr(1).simplify_path(); } else { - autoload.path = path; + autoload.path = path.simplify_path(); } add_autoload(autoload); } else if (p_name.operator String().begins_with("global_group/")) { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index a1ea94667da2..433f767f1e26 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -413,7 +413,7 @@ Error GDScriptParser::parse_binary(const Vector &p_binary, const String } tokenizer = buffer_tokenizer; - script_path = p_script_path; + script_path = p_script_path.simplify_path(); current = tokenizer->scan(); // Avoid error or newline as the first token. // The latter can mess with the parser when opening files filled exclusively with comments and newlines.