From 9b3816c993f6ad4c42b3f33811f08c532ef15b63 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 26 Feb 2023 17:25:45 +0100 Subject: [PATCH] InputCommon: Fix ControlGroup::SaveConfig with DefaultValue::Disabled I also changed LoadConfig, but that change doesn't affect correctness, it's only so it looks neat by matching SaveConfig. This bug was added in 18a4afb053e8b5f356e22cfc5aec8cc27700710b, the commit that introduced DefaultValue::Disabled. The bug can't actually be triggered in master, but it can be triggered in the Android input overhaul PR. --- .../InputCommon/ControllerEmu/ControlGroup/ControlGroup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/ControlGroup.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/ControlGroup.cpp index 890c43a848..0b69c7e6c2 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/ControlGroup.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/ControlGroup.cpp @@ -57,7 +57,7 @@ void ControlGroup::LoadConfig(IniFile::Section* sec, const std::string& defdev, // enabled if (default_value != DefaultValue::AlwaysEnabled) - sec->Get(group + "Enabled", &enabled, default_value == DefaultValue::Enabled); + sec->Get(group + "Enabled", &enabled, default_value != DefaultValue::Disabled); for (auto& setting : numeric_settings) setting->LoadFromIni(*sec, group); @@ -109,7 +109,7 @@ void ControlGroup::SaveConfig(IniFile::Section* sec, const std::string& defdev, const std::string group(base + name + "/"); // enabled - sec->Set(group + "Enabled", enabled, true); + sec->Set(group + "Enabled", enabled, default_value != DefaultValue::Disabled); for (auto& setting : numeric_settings) setting->SaveToIni(*sec, group);