mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 02:46:49 +00:00
Fix duplicate insertion error when detecting incompatible mods.
Since f1acd22455, mods are checked for compatibility. However, they can
incorrectly be checked & added to inompatible mods several time, leading
to a potential crash.
The new code can also be simplified slightly.
Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D4276
This was SVN commit r25926.
This commit is contained in:
+2
-10
@@ -324,17 +324,9 @@ std::vector<CStr> Mod::CheckForIncompatibleMods(const std::vector<CStr>& mods) c
|
||||
//0.0.24
|
||||
const CStr versionToCheck = dep.substr(pos + op.size());
|
||||
const std::unordered_map<CStr, CStr>::iterator it = modNameVersions.find(modToCheck);
|
||||
if (it == modNameVersions.end())
|
||||
{
|
||||
// Could not find the mod, or 0.0.25(0ad) , <=, 0.0.24(required version)
|
||||
if (it == modNameVersions.end() || !CompareVersionStrings(it->second, op, versionToCheck))
|
||||
incompatibleMods.push_back(mod);
|
||||
continue;
|
||||
}
|
||||
// 0.0.25(0ad) , <=, 0.0.24(required version)
|
||||
if (!CompareVersionStrings(it->second, op, versionToCheck))
|
||||
{
|
||||
incompatibleMods.push_back(mod);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user