mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 17:39:42 +00:00
Fix defaulted
in ConfigurationManager::mergeComposingVariables
This commit is contained in:
parent
9c1ff16b62
commit
5b23ba3faf
1 changed files with 3 additions and 3 deletions
|
@ -187,7 +187,7 @@ void mergeComposingVariables(boost::program_options::variables_map& first, boost
|
||||||
if (description.find_nothrow("replace", false))
|
if (description.find_nothrow("replace", false))
|
||||||
{
|
{
|
||||||
auto replace = second["replace"];
|
auto replace = second["replace"];
|
||||||
if (!replace.empty())
|
if (!replace.defaulted() && !replace.empty())
|
||||||
{
|
{
|
||||||
std::vector<std::string> replaceVector = replace.as<std::vector<std::string>>();
|
std::vector<std::string> replaceVector = replace.as<std::vector<std::string>>();
|
||||||
replacedVariables.insert(replaceVector.begin(), replaceVector.end());
|
replacedVariables.insert(replaceVector.begin(), replaceVector.end());
|
||||||
|
@ -206,13 +206,13 @@ void mergeComposingVariables(boost::program_options::variables_map& first, boost
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (replacedVariables.count(name))
|
if (replacedVariables.count(name) || firstPosition->second.defaulted() || firstPosition->second.empty())
|
||||||
{
|
{
|
||||||
firstPosition->second = second[name];
|
firstPosition->second = second[name];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (second[name].empty())
|
if (second[name].defaulted() || second[name].empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
boost::any& firstValue = firstPosition->second.value();
|
boost::any& firstValue = firstPosition->second.value();
|
||||||
|
|
Loading…
Reference in a new issue