From bdc2eb5250a4f5afe061c8b60382bfa730d3aea6 Mon Sep 17 00:00:00 2001 From: elsid Date: Mon, 10 Apr 2023 15:37:46 +0200 Subject: [PATCH] Check only original default settings When more than 1 user config layers are used we still want to check only the first layer of default settings loaded from settings-default.cfg. --- components/settings/settings.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/settings/settings.cpp b/components/settings/settings.cpp index a99038cf08..2ae4d4b63a 100644 --- a/components/settings/settings.cpp +++ b/components/settings/settings.cpp @@ -130,6 +130,8 @@ namespace Settings + "\" was properly installed."); parser.loadSettingsFile(defaultsBin, mDefaultSettings, true, false); + const CategorySettingValueMap originalDefaultSettings = mDefaultSettings; + // Load "settings.cfg" or "openmw-cs.cfg" from every config dir except the last one as additional default // settings. for (int i = 0; i < static_cast(paths.size()) - 1; ++i) @@ -147,7 +149,7 @@ namespace Settings Settings::Values::init(); - for (const auto& [key, value] : mDefaultSettings) + for (const auto& [key, value] : originalDefaultSettings) if (!sInitialized.contains(key)) throw std::runtime_error("Default setting [" + key.first + "] " + key.second + " is not initialized");