diff --git a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt index 22f2fee943..f16cda1443 100644 --- a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt @@ -352,7 +352,9 @@ object UnitAutomation { val unitDistanceToTiles = unit.movement.getDistanceToTiles() val tilesThatCanWalkToAndThenPillage = unitDistanceToTiles .filter { it.value.totalDistance < unit.currentMovement }.keys - .filter { unit.movement.canMoveTo(it) && UnitActions.canPillage(unit, it) } + .filter { unit.movement.canMoveTo(it) && UnitActions.canPillage(unit, it) + && (it.canPillageTileImprovement() + || (it.canPillageRoad() && it.roadOwner != "" && unit.civInfo.isAtWarWith(it.getRoadOwner()!!)))} if (tilesThatCanWalkToAndThenPillage.isEmpty()) return false val tileToPillage = tilesThatCanWalkToAndThenPillage.maxByOrNull { it.getDefensiveBonus() }!! diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt index d998fd0e10..349b1d0d54 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt @@ -886,10 +886,7 @@ object UnitActions { if (!tile.canPillageTile()) return false val tileOwner = tile.getOwner() // Can't pillage friendly tiles, just like you can't attack them - it's an 'act of war' thing - return if (tileOwner != null) - unit.civInfo.isAtWarWith(tileOwner) - else if (tile.canPillageTile()) true - else (tile.canPillageRoad() && tile.roadOwner != "" && unit.civInfo.isAtWarWith(tile.getRoadOwner()!!)) + return tileOwner == null || unit.civInfo.isAtWarWith(tileOwner) } private fun addGiftAction(unit: MapUnit, actionList: ArrayList, tile: TileInfo) {