mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
Do not write mods that do not affect gameplay to saved games
This commit is contained in:
parent
ecc88fabc1
commit
6af2609e0f
@ -17,9 +17,14 @@
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
std::vector<TModID> ActiveModsInSaveList::getActiveMods()
|
||||
std::vector<TModID> ActiveModsInSaveList::getActiveGameplayAffectingMods()
|
||||
{
|
||||
return VLC->modh->getActiveMods();
|
||||
std::vector<TModID> result;
|
||||
for (auto const & entry : VLC->modh->getActiveMods())
|
||||
if (VLC->modh->getModInfo(entry).checkModGameplayAffecting())
|
||||
result.push_back(entry);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
const ModVerificationInfo & ActiveModsInSaveList::getVerificationInfo(TModID mod)
|
||||
|
@ -16,7 +16,7 @@ VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
class ActiveModsInSaveList
|
||||
{
|
||||
std::vector<TModID> getActiveMods();
|
||||
std::vector<TModID> getActiveGameplayAffectingMods();
|
||||
const ModVerificationInfo & getVerificationInfo(TModID mod);
|
||||
|
||||
/// Checks whether provided mod list is compatible with current VLC and throws on failure
|
||||
@ -26,7 +26,7 @@ public:
|
||||
{
|
||||
if(h.saving)
|
||||
{
|
||||
std::vector<TModID> activeMods = getActiveMods();
|
||||
std::vector<TModID> activeMods = getActiveGameplayAffectingMods();
|
||||
h & activeMods;
|
||||
for(const auto & m : activeMods)
|
||||
h & getVerificationInfo(m);
|
||||
|
Loading…
x
Reference in New Issue
Block a user