From 7fbdfd13e513a0e37b302e15107e7d41019e50c9 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Tue, 26 Nov 2024 08:32:05 +0200 Subject: [PATCH] More #12522 edge case --- core/src/com/unciv/logic/automation/unit/UnitAutomation.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt index f0c9e507df..2a32ddde26 100644 --- a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt @@ -333,7 +333,8 @@ object UnitAutomation { } if (unit.movement.canUnitSwapTo(retreatTile)) { unit.movement.headTowards(retreatTile) // we need to move through the intermediate tiles - if (unit.currentTile.neighbors.contains(otherUnit.currentTile)) { + // if nothing changed + if (unit.currentTile.neighbors.contains(otherUnit.currentTile) && unit.movement.canUnitSwapTo(retreatTile)) { unit.movement.swapMoveToTile(retreatTile) } return true