From a97b84378c2b5aee85e66948ca763413d1532178 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Tue, 4 Aug 2020 15:46:40 +0200 Subject: [PATCH] Remap script path when registering class. Was causing `class_name`-defined scripts to not being loaded in exported games due to the remap from `*.gd` to `*.gdc`/`*.gde`. (cherry picked from commit fceb64827ea50364f34f4ba9db3910602d1911bf) --- core/script_language.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/script_language.cpp b/core/script_language.cpp index 2e8ebd40715..ff96842d3bf 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -31,6 +31,7 @@ #include "script_language.h" #include "core/core_string_names.h" +#include "core/io/resource_loader.h" #include "core/os/file_access.h" #include "core/project_settings.h" @@ -167,7 +168,7 @@ void ScriptServer::init_languages() { for (int i = 0; i < script_classes.size(); i++) { Dictionary c = script_classes[i]; - if (!c.has("class") || !c.has("language") || !c.has("path") || !FileAccess::exists(c["path"]) || !c.has("base")) + if (!c.has("class") || !c.has("language") || !c.has("path") || !FileAccess::exists(ResourceLoader::path_remap(c["path"])) || !c.has("base")) continue; add_global_class(c["class"], c["base"], c["language"], c["path"]); }