mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Units that can enter foreign lands without open borders are not expelled on open borders end
This commit is contained in:
parent
ae8d69b5b3
commit
fc81d7dda3
@ -454,6 +454,8 @@ class UnitMovement(val unit: MapUnit) {
|
||||
var allowedTile: Tile? = null
|
||||
var distance = 0
|
||||
// When we didn't limit the allowed distance the game would sometimes spend a whole minute looking for a suitable tile.
|
||||
|
||||
if (canPassThrough(unit.getTile())) return // This unit can stay here - e.g. it has "May enter foreign tiles without open borders"
|
||||
while (allowedTile == null && distance < 5) {
|
||||
distance++
|
||||
allowedTile = unit.getTile().getTilesAtDistance(distance)
|
||||
|
Loading…
x
Reference in New Issue
Block a user