Skip to content

Commit

Permalink
Resolved #12843 - Automation handles "Found City" uniques with limite…
Browse files Browse the repository at this point in the history
…d uses correctly
  • Loading branch information
yairm210 committed Jan 22, 2025
1 parent 21bfe2c commit 7828aa9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ object CivilianUnitAutomation {
&& unit.civ.units.getCivUnits().any { unit.hasUnique(UniqueType.AddInCapital) }

fun automateCivilianUnit(unit: MapUnit, dangerousTiles: HashSet<Tile>) {
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
Expand Down

0 comments on commit 7828aa9

Please sign in to comment.