From 6a98d8dd701e1eed9e6c65dfbfe5fcb3364c30ec Mon Sep 17 00:00:00 2001 From: itanasi <44038014+itanasi@users.noreply.github.com> Date: Fri, 28 Jan 2022 00:56:10 -0800 Subject: [PATCH] Minor logic cleanup (#6066) Co-authored-by: temurakami --- core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt index 673dd1d545..14ec0b5083 100644 --- a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt +++ b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt @@ -619,12 +619,13 @@ class UnitMovementAlgorithms(val unit:MapUnit) { if (!unit.canEnterForeignTerrain && !tile.canCivPassThrough(unit.civInfo)) return false val firstUnit = tile.getFirstUnit() - if (firstUnit != null) { + // Moving to non-empty tile + if (firstUnit != null && unit.civInfo != firstUnit.civInfo) { // Allow movement through unguarded, at-war Civilian Unit. Capture on the way - if (tile.getUnguardedCivilian() != null && unit.civInfo != firstUnit.civInfo && unit.civInfo.isAtWarWith(tile.civilianUnit!!.civInfo)) + if (tile.getUnguardedCivilian() != null && unit.civInfo.isAtWarWith(tile.civilianUnit!!.civInfo)) return true // Cannot enter hostile tile with any unit in there - if (firstUnit.civInfo != unit.civInfo && unit.civInfo.isAtWarWith(firstUnit.civInfo)) + if (unit.civInfo.isAtWarWith(firstUnit.civInfo)) return false }