mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 23:14:25 +07:00
Update ReligiousUnitAutomation.kt (#12444)
This commit is contained in:
parent
08378cb3c8
commit
ba4003bb30
@ -105,17 +105,11 @@ object ReligiousUnitAutomation {
|
||||
}
|
||||
|
||||
if (destinationCity == null) return
|
||||
var destinationTile = destinationCity.getCenterTile()
|
||||
|
||||
if (!unit.movement.canReach(destinationTile)
|
||||
// Wait for the addInCapital units to go to the city!
|
||||
|| CivilianUnitAutomation.shouldClearTileForAddInCapitalUnits(unit, destinationTile)) {
|
||||
destinationTile = destinationTile.neighbors
|
||||
val destinationTile = destinationCity.getCenterTile().neighbors
|
||||
.filter { unit.movement.canMoveTo(it) || it == unit.getTile() }
|
||||
.sortedBy { it.aerialDistanceTo(unit.currentTile) }
|
||||
.firstOrNull { unit.movement.canReach(it) }
|
||||
?: return
|
||||
}
|
||||
|
||||
unit.movement.headTowards(destinationTile)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user