diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 0b31ee359e..dbd711c93a 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -227,7 +227,8 @@ class MapUnit { var unit = baseUnit() // Go up the upgrade tree until you find the last one which is buildable - while (unit.upgradesTo!=null && civInfo.tech.isResearched(unit.getDirectUpgradeUnit(civInfo).requiredTech!!)) + while (unit.upgradesTo!=null && unit.getDirectUpgradeUnit(civInfo).requiredTech + .let { it==null || civInfo.tech.isResearched(it) }) unit = unit.getDirectUpgradeUnit(civInfo) return unit } diff --git a/core/src/com/unciv/models/ruleset/Ruleset.kt b/core/src/com/unciv/models/ruleset/Ruleset.kt index 3e93d2b069..253d67fd31 100644 --- a/core/src/com/unciv/models/ruleset/Ruleset.kt +++ b/core/src/com/unciv/models/ruleset/Ruleset.kt @@ -250,8 +250,7 @@ class Ruleset { for (promotion in unit.promotions) if (!unitPromotions.containsKey(promotion)) lines += "${unit.replaces} contains promotion $promotion which does not exist!" - if (unit.upgradesTo != null && units.containsKey(unit.upgradesTo!!) && units[unit.upgradesTo!!]!!.requiredTech == null) - lines += "${unit.name} upgrades to ${unit.upgradesTo} which has no required tech!" + } for (building in buildings.values) {