summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/script_language.cpp6
-rw-r--r--core/ustring.cpp5
2 files changed, 8 insertions, 3 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();
}
diff --git a/core/ustring.cpp b/core/ustring.cpp
index d5afbc2b47..0033c31e20 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -4484,11 +4484,12 @@ String String::sprintf(const Array &values, bool *error) const {
int number_len = str.length();
// Padding.
+ int pad_chars_count = (value < 0 || show_sign) ? min_chars - 1 : min_chars;
String pad_char = pad_with_zeroes ? String("0") : String(" ");
if (left_justified) {
- str = str.rpad(min_chars, pad_char);
+ str = str.rpad(pad_chars_count, pad_char);
} else {
- str = str.lpad(min_chars, pad_char);
+ str = str.lpad(pad_chars_count, pad_char);
}
// Sign.