mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-20 19:56:51 +01:00
Resolved #12843 - Automation handles "Found City" uniques with limited uses correctly
This commit is contained in:
parent
21bfe2c79c
commit
7828aa9887
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user