From 5fa2e7be955da2f23bf9416677c595eb8f6e2dd8 Mon Sep 17 00:00:00 2001 From: EmperorPinguin <99119424+EmperorPinguin@users.noreply.github.com> Date: Sat, 14 Dec 2024 17:13:43 +0100 Subject: [PATCH] Update NextTurnAutomation.kt (#12634) --- .../unciv/logic/automation/civilization/NextTurnAutomation.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt index 290ea6ce40..3350baf5f2 100644 --- a/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt @@ -277,7 +277,9 @@ object NextTurnAutomation { val costs = getGroupedResearchableTechs() if (costs.isEmpty()) return - val cheapestTechs = costs[0] + val cheapestTechs = costs.firstOrNull{ + // Ignore rows where all techs have 0 weight + it.any { it.getWeightForAiDecision(stateForConditionals) > 0 } }?: costs.first() //Do not consider advanced techs if only one tech left in cheapest group val techToResearch: Technology = if (cheapestTechs.size == 1 || costs.size == 1) {