1
0
Fork 1
forked from suyu/suyu

frontend_common: config: Only write setting related to opened config file

If we tried to write a switchable setting to config that was not using global in the global config instance, we could write the per-game setting accidentally. This ensures that we always use the global setting for global config and the currently applied setting for custom config.
This commit is contained in:
t895 2024-01-03 22:16:54 -05:00
parent 1c278974a8
commit fa04dea7c4

View file

@ -894,9 +894,10 @@ void Config::WriteSettingGeneric(const Settings::BasicSetting* const setting) {
WriteBooleanSetting(std::string(key).append("\\use_global"), setting->UsingGlobal());
}
if (global || !setting->UsingGlobal()) {
auto value = global ? setting->ToStringGlobal() : setting->ToString();
WriteBooleanSetting(std::string(key).append("\\default"),
setting->ToString() == setting->DefaultToString());
WriteStringSetting(key, setting->ToString());
value == setting->DefaultToString());
WriteStringSetting(key, value);
}
} else if (global) {
WriteBooleanSetting(std::string(key).append("\\default"),