mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Improvements for json validation for mods
- Implemented validation for `targetCondition` in spells - Implemented validation for `mapObject` in towns/heroes - Fixed validation of zone connections in RMG - Added workarounds to prevent assertions triggering on invalid mods - Erase 'base' entries from json before validation (but after applying them to derived keys) Should have no effect on mod behavior/support, but may cause new detections for mods that were broken in either 1.6 or 1.7
This commit is contained in:
@@ -536,14 +536,16 @@ static std::shared_ptr<const ILimiter> parseCreatureTypeLimiter(const JsonNode &
|
||||
creatureLimiter->setCreature(CreatureID(creature));
|
||||
});
|
||||
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
creatureLimiter->includeUpgrades = upgradesNode.Bool();
|
||||
}
|
||||
|
||||
return creatureLimiter;
|
||||
}
|
||||
|
Reference in New Issue
Block a user