mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 17:28:57 +07:00
Units are not displaced to enemy land when kicked out of borders
This commit is contained in:
@ -404,8 +404,8 @@ class UnitMovementAlgorithms(val unit: MapUnit) {
|
||||
while (allowedTile == null && distance < 5) {
|
||||
distance++
|
||||
allowedTile = unit.getTile().getTilesAtDistance(distance)
|
||||
// can the unit be placed safely there?
|
||||
.filter { canMoveTo(it) }
|
||||
// can the unit be placed safely there? Is tile either unowned or friendly?
|
||||
.filter { canMoveTo(it) && it.getOwner()?.isAtWarWith(unit.civInfo) != true }
|
||||
// out of those where it can be placed, can it reach them in any meaningful way?
|
||||
.firstOrNull { getPathBetweenTiles(unit.currentTile, it).contains(it) }
|
||||
}
|
||||
|
Reference in New Issue
Block a user