Fix #17019 : overrides with unknown base setting

If at the time of the _GLOBAL_DEF call a setting itself was unknown,
the function would always return the supplied default value instead of
checking for overrides. This commit changes that, lookup now always
happens which correctly takes overrides into account.
This commit is contained in:
Manuel Moos 2018-02-25 21:05:40 +01:00 committed by Rémi Verschelde
parent 007d1754e3
commit 954f7cca60

View File

@ -816,12 +816,11 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust
Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default) {
Variant ret;
if (ProjectSettings::get_singleton()->has_setting(p_var)) {
ret = ProjectSettings::get_singleton()->get(p_var);
} else {
if (!ProjectSettings::get_singleton()->has_setting(p_var)) {
ProjectSettings::get_singleton()->set(p_var, p_default);
ret = p_default;
}
ret = ProjectSettings::get_singleton()->get(p_var);
ProjectSettings::get_singleton()->set_initial_value(p_var, p_default);
ProjectSettings::get_singleton()->set_builtin_order(p_var);
return ret;