Resolved #2224 - can no longer enter the promotions screen from the overview screen if there are no valid promotions

This commit is contained in:
Yair Morgenstern 2020-03-22 20:42:22 +02:00
parent f6ba4cf409
commit 8836800957
2 changed files with 4 additions and 2 deletions

View file

@ -15,7 +15,9 @@ class UnitPromotions{
fun xpForNextPromotion() = (numberOfPromotions+1)*10
fun canBePromoted(): Boolean {
if(unit.type==UnitType.Missile) return false
return XP >= xpForNextPromotion()
if(XP < xpForNextPromotion()) return false
if(getAvailablePromotions().isEmpty()) return false
return true
}
fun addPromotion(promotionName: String, isFree: Boolean = false){

View file

@ -372,7 +372,7 @@ class EmpireOverviewScreen(private val viewingPlayer:CivilizationInfo) : CameraS
}
}
table.add(promotionsTable)
if (unit.health in 1..99) table.add(unit.health.toString()) else table.add()
if (unit.health < 100) table.add(unit.health.toString()) else table.add()
table.row()
}
table.pack()