Merge pull request #41025 from Faless/gdscript/fix_class_name

Remap script path when registering class.
This commit is contained in:
Rémi Verschelde 2020-08-11 20:02:35 +02:00 committed by GitHub
commit d3b5c0948c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"]);