Ruleset checks allow for unit types to be defined in default ruleset, since it's copied to all complex rulesets if no unit types are there

This commit is contained in:
yairm210 2021-08-12 20:45:15 +03:00
parent 8fec3b8345
commit 2ee4598e70

View File

@ -324,6 +324,7 @@ class Ruleset {
if (!modOptions.isBaseRuleset) return CheckModLinksResult(warningCount, lines)
val baseRuleset = RulesetCache.getBaseRuleset()
for (unit in units.values) {
if (unit.requiredTech != null && !technologies.containsKey(unit.requiredTech!!))
@ -340,7 +341,7 @@ class Ruleset {
for (promotion in unit.promotions)
if (!unitPromotions.containsKey(promotion))
lines += "${unit.name} contains promotion $promotion which does not exist!"
if (!unitTypes.containsKey(unit.unitType))
if (!unitTypes.containsKey(unit.unitType) && !baseRuleset.unitTypes.containsKey(unit.unitType))
lines += "${unit.name} is of type ${unit.unitType}, which does not exist!"
}