From 947a1001c41f0e2034dab2aa4d9a6efbbc648244 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 30 Jun 2023 15:13:14 +0300 Subject: [PATCH] Resolves #9703 - AI only buys tiles contiguous to the current city tiles (was: contiguous to civ tiles) --- android/assets/jsons/Civ V - Gods & Kings/Terrains.json | 2 +- android/assets/jsons/Civ V - Vanilla/Terrains.json | 2 +- .../unciv/logic/automation/civilization/NextTurnAutomation.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/Terrains.json b/android/assets/jsons/Civ V - Gods & Kings/Terrains.json index ea89d98f7a..d550016f01 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Terrains.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Terrains.json @@ -235,7 +235,7 @@ "uniques": ["Nullifies all other stats this tile provides", "Doesn't generate naturally"], // For map editor only - the generator won't place it without code or enabling uniques // If the map generator is ever updated to always take these into account, it should also take the "Doesn't generate naturally" unique into account - "occursOn": ["Grassland","Plains","Desert","Tundra","Snow","Forest","Jungle","Hill","Flood plains","Marsh","Oasis"] + "occursOn": ["Grassland","Plains","Desert","Tundra","Snow","Forest","Jungle","Hill","Flood plains","Marsh","Oasis"], "defenceBonus": -0.15 }, { diff --git a/android/assets/jsons/Civ V - Vanilla/Terrains.json b/android/assets/jsons/Civ V - Vanilla/Terrains.json index bcaa793650..c6644dd2b6 100644 --- a/android/assets/jsons/Civ V - Vanilla/Terrains.json +++ b/android/assets/jsons/Civ V - Vanilla/Terrains.json @@ -236,7 +236,7 @@ "uniques": ["Nullifies all other stats this tile provides", "Doesn't generate naturally"], // For map editor only - the generator won't place it without code or enabling uniques // If the map generator is ever updated to always take these into account, it should also take the "Doesn't generate naturally" unique into account - "occursOn": ["Grassland","Plains","Desert","Tundra","Snow","Forest","Jungle","Hill","Flood plains","Marsh","Oasis"] + "occursOn": ["Grassland","Plains","Desert","Tundra","Snow","Forest","Jungle","Hill","Flood plains","Marsh","Oasis"], "defenceBonus": -0.15 }, { diff --git a/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt index 68ef24763e..210bb12e6c 100644 --- a/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt @@ -386,11 +386,11 @@ object NextTurnAutomation { } val bfs = BFS(cityWithLeastCostToBuy.getCenterTile()) { - it.getOwner() == null || it.getOwner() == civInfo + it.getOwner() == null || it.owningCity == cityWithLeastCostToBuy } bfs.stepUntilDestination(highlyDesirableTile.key) val tilesThatNeedBuying = - bfs.getPathTo(highlyDesirableTile.key).filter { it.getOwner() != civInfo } + bfs.getPathTo(highlyDesirableTile.key).filter { it.getOwner() == null } .toList().reversed() // getPathTo is from destination to source // We're trying to acquire everything and revert if it fails, because of the difficult