From 6fb3ba0f13b3c5fbadca706726a8a947800518b7 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 24 Oct 2019 21:57:24 +0300 Subject: [PATCH] Resolved #1229 - AI doesn't choose to construct workers if the Civ has idle automated workers --- core/src/com/unciv/logic/automation/ConstructionAutomation.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/com/unciv/logic/automation/ConstructionAutomation.kt b/core/src/com/unciv/logic/automation/ConstructionAutomation.kt index 60f98c9d78..a9e9cd8781 100644 --- a/core/src/com/unciv/logic/automation/ConstructionAutomation.kt +++ b/core/src/com/unciv/logic/automation/ConstructionAutomation.kt @@ -112,6 +112,8 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){ } private fun addWorkerChoice() { + if(civInfo.getIdleUnits().any { it.name==Constants.worker && it.action== Constants.unitActionAutomation}) + return // If we have automated workers who have no work to do then it's silly to construct new workers. val citiesCountedTowardsWorkers = min(5, cities) // above 5 cities, extra cities won't make us want more workers if (workers < citiesCountedTowardsWorkers * 0.6f && civUnits.none { it.name==Constants.worker && it.isIdle() }) { var modifier = citiesCountedTowardsWorkers / (workers + 0.1f)