From 7828aa988779db05e52ebafc8007e42c18d0c6bc Mon Sep 17 00:00:00 2001 From: yairm210 Date: Wed, 22 Jan 2025 21:42:07 +0200 Subject: [PATCH] Resolved #12843 - Automation handles "Found City" uniques with limited uses correctly --- .../unciv/logic/automation/unit/CivilianUnitAutomation.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt index 97a218c435..274167d82d 100644 --- a/core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/CivilianUnitAutomation.kt @@ -18,7 +18,12 @@ object CivilianUnitAutomation { && unit.civ.units.getCivUnits().any { unit.hasUnique(UniqueType.AddInCapital) } fun automateCivilianUnit(unit: MapUnit, dangerousTiles: HashSet) { - if (unit.hasUnique(UniqueType.FoundCity)) + // To allow "found city" actions that can only trigger a limited number of times + val settlerUnique = + UnitActionModifiers.getUsableUnitActionUniques(unit, UniqueType.FoundCity).firstOrNull() ?: + UnitActionModifiers.getUsableUnitActionUniques(unit, UniqueType.FoundPuppetCity).firstOrNull() + + if (settlerUnique != null) return SpecificUnitAutomation.automateSettlerActions(unit, dangerousTiles) if (tryRunAwayIfNeccessary(unit)) return