From dd9e6221559a5dc374bff998342ee70bb8edf224 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 13 May 2017 14:27:16 +0100 Subject: [PATCH] GameConfigLoader: Fix blank keys for variable sections --- Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp index 6e15ce9a30..ecf19eecbb 100644 --- a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp @@ -196,7 +196,7 @@ static ConfigLocation MapINIToRealLocation(const std::string& section, const std // Certain sections like 'Speedhacks' has keys that are variable it = ini_to_location.find({section, ""}); if (it != ini_to_location.end()) - return it->second; + return {it->second.system, it->second.section, key}; // Attempt to load it as a configuration option // It will be in the format of '.
' @@ -230,11 +230,11 @@ static std::pair GetINILocationFromConfig(const Config // Try again, but this time with an empty key // Certain sections like 'Speedhacks' have keys that are variable it = std::find_if(ini_to_location.begin(), ini_to_location.end(), [&location](const auto& entry) { - return std::tie(entry.second.system, entry.second.key) == - std::tie(location.system, location.key); + return std::tie(entry.second.system, entry.second.section) == + std::tie(location.system, location.section); }); if (it != ini_to_location.end()) - return it->first; + return {it->first.first, location.key}; WARN_LOG(CORE, "Unknown option: %s.%s", location.section.c_str(), location.key.c_str()); return {"", ""};