summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-08-04 15:46:40 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-08-04 15:46:40 +0200
commitfceb64827ea50364f34f4ba9db3910602d1911bf (patch)
treeb3de3264b621cb7880bd29183bc5a5c6706ebea0 /core
parentec678c5e94ac1c91c099c15fabc398e80ede7bfe (diff)
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`.
Diffstat (limited to 'core')
-rw-r--r--core/script_language.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/script_language.cpp b/core/script_language.cpp
index 5176882662..360995ea15 100644
--- a/core/script_language.cpp
+++ b/core/script_language.cpp
@@ -33,6 +33,7 @@
#include "core/core_string_names.h"
#include "core/debugger/engine_debugger.h"
#include "core/debugger/script_debugger.h"
+#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
#include "core/project_settings.h"
@@ -163,7 +164,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"]);