Resolved #9247 #9246 #9248 #9252 #9237 - Great Merchant doesn't try to go to unreachable tiles

This commit is contained in:
Yair Morgenstern
2023-04-23 09:31:30 +03:00
parent 45ac4c2d59
commit 2b4dbe2ad2

View File

@ -266,7 +266,8 @@ object SpecificUnitAutomation {
.filter { unit.civ.hasExplored(it) }
.mapNotNull { 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
?: return false