summaryrefslogtreecommitdiffstats
path: root/core/script_language.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2020-10-03 04:36:07 -0400
committerAaron Franke <arnfranke@yahoo.com>2020-10-03 04:36:07 -0400
commit3163611f0c855feaf3bddad3afe9afd6fd3cc2c6 (patch)
treecb70e8a6bab0dccbb82c7605cac43f139d50d5e8 /core/script_language.cpp
parent9b1c9cef17ef06e5ae80309189464ca6afe7e551 (diff)
downloadredot-engine-3163611f0c855feaf3bddad3afe9afd6fd3cc2c6.tar.gz
Don't write global script class information if there is none
Diffstat (limited to 'core/script_language.cpp')
-rw-r--r--core/script_language.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/script_language.cpp b/core/script_language.cpp
index b63aeb952c..bb2e9a07ff 100644
--- a/core/script_language.cpp
+++ b/core/script_language.cpp
@@ -275,7 +275,11 @@ void ScriptServer::save_global_classes() {
gcarr.push_back(d);
}
- ProjectSettings::get_singleton()->set("_global_script_classes", gcarr);
+ if (gcarr.empty()) {
+ ProjectSettings::get_singleton()->clear("_global_script_classes");
+ } else {
+ ProjectSettings::get_singleton()->set("_global_script_classes", gcarr);
+ }
ProjectSettings::get_singleton()->save();
}