GameConfigLoader: Ignore unknown entries

It's not necessarily an issue. For example, memory breakpoints are
handled in a different location.
This commit is contained in:
Léo Lam 2017-02-15 16:50:19 +01:00
parent 9dbb6f9022
commit 4761afe179
1 changed files with 10 additions and 3 deletions

View File

@ -199,9 +199,8 @@ MapINIToRealLocation(const std::string& section, const std::string& key)
if (!fail)
return std::make_tuple(Config::GetSystemFromName(system_str), config_section, key);
ERROR_LOG(COMMON, "Couldn't load game INI option %s-%s properly!\n", section.c_str(),
key.c_str());
return std::make_tuple(Config::System::Main, "FAIL!", key);
WARN_LOG(COMMON, "Unknown game INI option in section %s: %s", section.c_str(), key.c_str());
return std::make_tuple(Config::System::Main, "", "");
}
return ini_to_location[std::make_pair(section, key)];
@ -246,6 +245,10 @@ public:
{
std::tuple<Config::System, std::string, std::string> mapped_config =
MapINIToRealLocation(section_name, "");
if (std::get<1>(mapped_config).empty() && std::get<2>(mapped_config).empty())
continue;
auto* config_section = config_layer->GetOrCreateSection(std::get<0>(mapped_config),
std::get<1>(mapped_config));
config_section->SetLines(chunk);
@ -259,6 +262,10 @@ public:
{
std::tuple<Config::System, std::string, std::string> mapped_config =
MapINIToRealLocation(section_name, value.first);
if (std::get<1>(mapped_config).empty() && std::get<2>(mapped_config).empty())
continue;
auto* config_section = config_layer->GetOrCreateSection(std::get<0>(mapped_config),
std::get<1>(mapped_config));