mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 01:39:40 +07:00
This commit is contained in:
@ -266,7 +266,8 @@ object SpecificUnitAutomation {
|
|||||||
.filter { unit.civ.hasExplored(it) }
|
.filter { unit.civ.hasExplored(it) }
|
||||||
.mapNotNull { tile ->
|
.mapNotNull { tile ->
|
||||||
val path = unit.movement.getShortestPath(tile)
|
val path = unit.movement.getShortestPath(tile)
|
||||||
if (path.size <= 10) tile to path.size else null
|
// 0 is unreachable, 10 is too far away
|
||||||
|
if (path.size in 1..10) tile to path.size else null
|
||||||
}
|
}
|
||||||
.minByOrNull { it.second }?.first
|
.minByOrNull { it.second }?.first
|
||||||
?: return false
|
?: return false
|
||||||
|
Reference in New Issue
Block a user