mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Can now handle units upgrading to units with no required tech
This commit is contained in:
parent
114effe1ae
commit
7b0bb55045
@ -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
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user