Units that can enter foreign lands without open borders are not expelled on open borders end

This commit is contained in:
Yair Morgenstern
2023-05-22 14:02:28 +03:00
parent ae8d69b5b3
commit fc81d7dda3

View File

@ -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)