mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-21 09:47:33 +07:00
Fix great general automation exception.
This commit is contained in:
parent
05657ea131
commit
2e91b9f84e
@ -413,7 +413,7 @@ class SpecificUnitAutomation{
|
||||
|
||||
//if no unit to follow, take refuge in city.
|
||||
val cityToGarison = unit.civInfo.cities.map {it.getCenterTile()}
|
||||
.filter {it.civilianUnit == null && unit.canMoveTo(it)}
|
||||
.filter {it.civilianUnit == null && unit.canMoveTo(it) && unit.movementAlgs().canReach(it)}
|
||||
.minBy { it.arialDistanceTo(unit.currentTile) }
|
||||
if (cityToGarison != null) {
|
||||
unit.movementAlgs().headTowards(cityToGarison)
|
||||
|
Loading…
Reference in New Issue
Block a user