mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-19 16:57:38 +07:00
Automated workers no longer stay on unimprovable tile if another tile is improvable
This commit is contained in:
parent
e0505d1eb7
commit
f8b4b202e7
@ -86,7 +86,7 @@ class WorkerAutomation(
|
||||
if (result.isEmpty())
|
||||
debug("\tempty")
|
||||
else result.forEach {
|
||||
debug("\t$it") // ${it.getCity()?.name} included in Tile toString()
|
||||
debug("\t$it")
|
||||
}
|
||||
}
|
||||
result
|
||||
@ -297,8 +297,9 @@ class WorkerAutomation(
|
||||
val selectedTile = workableTiles.firstOrNull { unit.movement.canReach(it) && (tileCanBeImproved(unit, it) || it.isPillaged()) }
|
||||
|
||||
return if (selectedTile != null
|
||||
&& (!workableTiles.contains(currentTile)
|
||||
|| getPriority(selectedTile) > getPriority(currentTile)))
|
||||
&& ((!tileCanBeImproved(unit, currentTile) && !currentTile.isPillaged()) // current tile is unimprovable
|
||||
|| !workableTiles.contains(currentTile) // current tile is unworkable by city
|
||||
|| getPriority(selectedTile) > getPriority(currentTile))) // current tile is less important
|
||||
selectedTile
|
||||
else currentTile
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user