From eb0776005f2a63413dcb3df974924025eacec265 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 24 Nov 2020 21:43:00 +0200 Subject: [PATCH] Added mod checks that combat units have strength and ranged units have rangedStrength --- core/src/com/unciv/models/ruleset/Ruleset.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/models/ruleset/Ruleset.kt b/core/src/com/unciv/models/ruleset/Ruleset.kt index 253d67fd31..134a6afd82 100644 --- a/core/src/com/unciv/models/ruleset/Ruleset.kt +++ b/core/src/com/unciv/models/ruleset/Ruleset.kt @@ -217,9 +217,14 @@ class Ruleset { val lines = ArrayList() // Checks for all mods - for (unit in units.values) + for (unit in units.values) { if (unit.upgradesTo == unit.name) lines += "${unit.name} upgrades to itself!" + if (!unit.unitType.isCivilian() && unit.strength == 0) + lines += "${unit.name} is a military unit but has no assigned strength!" + if (unit.unitType.isRanged() && unit.rangedStrength == 0) + lines += "${unit.name} is a ranged unit but has no assigned rangedStrength!" + } for (tech in technologies.values) { for (otherTech in tech.column!!.techs) {