diff options
| author | t895 <clombardo169@gmail.com> | 2024-01-03 22:16:54 -0500 |
|---|---|---|
| committer | t895 <clombardo169@gmail.com> | 2024-01-03 22:49:41 -0500 |
| commit | 5c8b1d9d3cbe91470e4d313316c9f504ac9c5de7 (patch) | |
| tree | 220d650ef629fc34561e6ee7cc3ea18106e3244d /src/frontend_common/config.cpp | |
| parent | 89ef2a6bac1c4aab69e50dd82ff42efe8eef5c09 (diff) | |
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.
Diffstat (limited to 'src/frontend_common/config.cpp')
| -rw-r--r-- | src/frontend_common/config.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/frontend_common/config.cpp b/src/frontend_common/config.cpp index 51576b4eeb..678e27ef8a 100644 --- a/src/frontend_common/config.cpp +++ b/src/frontend_common/config.cpp @@ -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"), |
