mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-27 21:49:10 +02:00
Remove any modification of enabled mods during game loading
This commit is contained in:
parent
61141a0406
commit
2a3e371caf
@ -481,7 +481,7 @@ void CModHandler::trySetActiveMods(const std::vector<std::pair<TModID, CModInfo:
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
std::vector<TModID> newActiveMods, missingMods, excessiveMods;
|
||||
std::vector<TModID> missingMods, excessiveMods;
|
||||
ModIncompatibility::ModListWithVersion missingModsResult;
|
||||
ModIncompatibility::ModList excessiveModsResult;
|
||||
|
||||
@ -492,10 +492,7 @@ void CModHandler::trySetActiveMods(const std::vector<std::pair<TModID, CModInfo:
|
||||
|
||||
//TODO: support actual disabling of these mods
|
||||
if(getModInfo(m).checkModGameplayAffecting())
|
||||
{
|
||||
excessiveMods.push_back(m);
|
||||
allMods[m].setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
for(const auto & infoPair : modList)
|
||||
@ -523,10 +520,7 @@ void CModHandler::trySetActiveMods(const std::vector<std::pair<TModID, CModInfo:
|
||||
bool modLocalyEnabled = vstd::contains(activeMods, remoteModId);
|
||||
|
||||
if(modVersionCompatible && modAffectsGameplay && modLocalyEnabled)
|
||||
{
|
||||
newActiveMods.push_back(remoteModId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(modAffectsGameplay)
|
||||
missingMods.push_back(remoteModId); //incompatible mod impacts gameplay
|
||||
@ -555,11 +549,7 @@ void CModHandler::trySetActiveMods(const std::vector<std::pair<TModID, CModInfo:
|
||||
if(!missingModsResult.empty() || !excessiveModsResult.empty())
|
||||
throw ModIncompatibility(missingModsResult, excessiveModsResult);
|
||||
|
||||
//TODO: support actual enabling of these mods
|
||||
for(auto & m : newActiveMods)
|
||||
allMods[m].setEnabled(true);
|
||||
|
||||
std::swap(activeMods, newActiveMods);
|
||||
//TODO: support actual enabling of required mods
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
Loading…
x
Reference in New Issue
Block a user