diff options
Diffstat (limited to 'core/script_language.cpp')
-rw-r--r-- | core/script_language.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/script_language.cpp b/core/script_language.cpp index 360995ea15..d535c54dea 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -33,8 +33,6 @@ #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" #include <stdint.h> @@ -164,7 +162,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(ResourceLoader::path_remap(c["path"])) || !c.has("base")) { + if (!c.has("class") || !c.has("language") || !c.has("path") || !c.has("base")) { continue; } add_global_class(c["class"], c["base"], c["language"], c["path"]); @@ -277,7 +275,13 @@ void ScriptServer::save_global_classes() { gcarr.push_back(d); } - ProjectSettings::get_singleton()->set("_global_script_classes", gcarr); + if (gcarr.empty()) { + if (ProjectSettings::get_singleton()->has_setting("_global_script_classes")) { + ProjectSettings::get_singleton()->clear("_global_script_classes"); + } + } else { + ProjectSettings::get_singleton()->set("_global_script_classes", gcarr); + } ProjectSettings::get_singleton()->save(); } |