From 2b4dbe2ad2f3aa000c388ef8f0033195b8bd6ca1 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 23 Apr 2023 09:31:30 +0300 Subject: [PATCH] Resolved #9247 #9246 #9248 #9252 #9237 - Great Merchant doesn't try to go to unreachable tiles --- .../com/unciv/logic/automation/unit/SpecificUnitAutomation.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt index 927024c8d6..9e64bff7dd 100644 --- a/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt @@ -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