mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-25 22:59:12 +07:00
Resolved #5752 - don't show 'fortify until healed' if the unit won't actually heal in this tile
This commit is contained in:
parent
144d2738a4
commit
31639aac9f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user