Added mod checks that combat units have strength and ranged units have rangedStrength

This commit is contained in:
Yair Morgenstern 2020-11-24 21:43:00 +02:00
parent f6f95a7c53
commit eb0776005f

View File

@ -217,9 +217,14 @@ class Ruleset {
val lines = ArrayList<String>() val lines = ArrayList<String>()
// Checks for all mods // Checks for all mods
for (unit in units.values) for (unit in units.values) {
if (unit.upgradesTo == unit.name) if (unit.upgradesTo == unit.name)
lines += "${unit.name} upgrades to itself!" 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 (tech in technologies.values) {
for (otherTech in tech.column!!.techs) { for (otherTech in tech.column!!.techs) {