mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Add workaround for mods that use "true"
(string) instead of real bool
This commit is contained in:
@@ -537,6 +537,14 @@ static std::shared_ptr<const ILimiter> parseCreatureTypeLimiter(const JsonNode &
|
||||
});
|
||||
|
||||
creatureLimiter->includeUpgrades = upgradesNode.Bool();
|
||||
|
||||
if (upgradesNode.isString())
|
||||
{
|
||||
logGlobal->warn("CREATURE_TYPE_LIMITER: parameter 'includeUpgrades' is invalid! expected boolean, but string '%s' found!", upgradesNode.String());
|
||||
if (upgradesNode.String() == "true") // MOD COMPATIBILITY - broken mod, compensating
|
||||
creatureLimiter->includeUpgrades = true;
|
||||
}
|
||||
|
||||
return creatureLimiter;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user