From 31639aac9fa739924a9bfb83543a552c0fa069e9 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Sun, 5 Dec 2021 21:38:27 +0200 Subject: [PATCH] Resolved #5752 - don't show 'fortify until healed' if the unit won't actually heal in this tile --- .../unciv/ui/worldscreen/unit/UnitActions.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt index 6f91561466..f77526faea 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt @@ -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, unit: MapUnit, showingAdditionalActions: Boolean) {