1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fixed loading of settings from mods

This commit is contained in:
Ivan Savenko
2023-03-16 17:39:35 +02:00
parent 2207c0dfb2
commit aea2a1e22e
4 changed files with 24 additions and 6 deletions

View File

@@ -91,9 +91,12 @@ void GameSettings::load(const JsonNode & input)
for(const auto & option : optionPath)
{
const JsonNode & optionValue = input[option.group][option.key];
size_t index = static_cast<size_t>(option.setting);
if(!optionValue.isNull())
gameSettings[static_cast<size_t>(option.setting)] = optionValue;
if(optionValue.isNull())
continue;
JsonUtils::mergeCopy(gameSettings[index], optionValue);
}
}