From 307aea1cc095d85d40e0af20eb159fe59b37e100 Mon Sep 17 00:00:00 2001 From: Duan Tao Date: Mon, 29 Apr 2019 10:02:14 +0800 Subject: [PATCH] Fixed : AI city under seige change production every turn. --- core/src/com/unciv/logic/automation/Automation.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index fef7997a88..5d0d12ce1e 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -52,6 +52,8 @@ class Automation { fun chooseMilitaryUnit(city: CityInfo) : String { val militaryUnits = city.cityConstructions.getConstructableUnits().filter { !it.unitType.isCivilian() } + if (militaryUnits.map { it.name }.contains(city.cityConstructions.currentConstruction)) + return city.cityConstructions.currentConstruction val chosenUnit: BaseUnit if(!city.civInfo.isAtWar() && city.civInfo.cities.any { it.getCenterTile().militaryUnit==null} && militaryUnits.any { it.unitType== UnitType.Ranged }) // this is for city defence so get an archery unit if we can