From 027e56d6a7044ca1be688c58e2ecb34fdec77925 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Sat, 6 Apr 2024 23:45:40 +0300 Subject: [PATCH] Resolved #11400 - unclear settler edge case --- .../com/unciv/logic/automation/unit/SpecificUnitAutomation.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt index ff2b333972..3f3018305a 100644 --- a/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt @@ -133,7 +133,7 @@ object SpecificUnitAutomation { // If the tile we are currently on is close to the best tile, then lets just settle here instead if (bestTilesInfo.tileRankMap.containsKey(unit.getTile()) - && (bestTilesInfo.bestTile == null || bestTilesInfo.tileRankMap[unit.getTile()]!! >= bestTilesInfo.tileRankMap[bestTilesInfo.bestTile]!! - 10)) { + && (bestTilesInfo.bestTile == null || bestTilesInfo.tileRankMap[unit.getTile()]!! >= bestTilesInfo.bestTileRank - 10)) { bestCityLocation = unit.getTile() } @@ -151,7 +151,7 @@ object SpecificUnitAutomation { } bestCityLocation = bestTilesInfo.tileRankMap.entries.asSequence() - .filter { bestTilesInfo.bestTile == null || it.value >= bestTilesInfo.tileRankMap[bestTilesInfo.bestTile]!! - 5 } + .filter { bestTilesInfo.bestTile == null || it.value >= bestTilesInfo.bestTileRank - 5 } .sortedByDescending { it.value } .firstOrNull(::isTileRankOK) ?.key