Resolved #5752 - don't show 'fortify until healed' if the unit won't actually heal in this tile

This commit is contained in:
yairm210 2021-12-05 21:38:27 +02:00
parent 144d2738a4
commit 31639aac9f

View File

@ -721,18 +721,18 @@ object UnitActions {
val isFortified = unit.isFortified()
val isDamaged = unit.health < 100
if (isDamaged && !showingAdditionalActions)
if (isDamaged && !showingAdditionalActions && unit.rankTileForHealing(unit.currentTile) != 0)
actionList += UnitAction(UnitActionType.FortifyUntilHealed,
action = {
unit.fortifyUntilHealed()
}.takeIf { !unit.isFortifyingUntilHealed() }
)
action = {
unit.fortifyUntilHealed()
}.takeIf { !unit.isFortifyingUntilHealed() }
)
else if (isDamaged || !showingAdditionalActions)
actionList += UnitAction(UnitActionType.Fortify,
action = {
unit.fortify()
}.takeIf { !isFortified }
)
action = {
unit.fortify()
}.takeIf { !isFortified }
)
}
private fun addSleepActions(actionList: ArrayList<UnitAction>, unit: MapUnit, showingAdditionalActions: Boolean) {