Skip to content

Commit

Permalink
More #12522 edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Nov 26, 2024
1 parent 72329ae commit 7fbdfd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/com/unciv/logic/automation/unit/UnitAutomation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7fbdfd1

Please sign in to comment.