Fixed "cannot upgrade to last unit"

This commit is contained in:
Yair Morgenstern 2022-12-24 19:22:39 +02:00
parent 78c4f6de68
commit fd0279c187

View File

@ -502,8 +502,8 @@ class MapUnit : IsPartOfGameInfoSerialization {
val upgradeList = arrayListOf<BaseUnit>() val upgradeList = arrayListOf<BaseUnit>()
while (currentUnit.upgradesTo != null){ while (currentUnit.upgradesTo != null){
val nextUpgrade = civInfo.getEquivalentUnit(currentUnit.upgradesTo!!) val nextUpgrade = civInfo.getEquivalentUnit(currentUnit.upgradesTo!!)
upgradeList.add(currentUnit)
currentUnit = nextUpgrade currentUnit = nextUpgrade
upgradeList.add(currentUnit)
} }
return upgradeList return upgradeList
} }