mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 23:14:25 +07:00
Use unit state for trigger conditionals for gaining new units (#12660)
This commit is contained in:
parent
e7b73c05cd
commit
7918123a79
@ -102,14 +102,14 @@ class UnitManager(val civInfo: Civilization) {
|
||||
if (!unique.hasTriggerConditional() && unique.conditionalsApply(unit.cache.state))
|
||||
UniqueTriggerActivation.triggerUnique(unique, unit, triggerNotificationText = triggerNotificationText)
|
||||
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponGainingUnit)
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponGainingUnit, unit.cache.state)
|
||||
{ unit.matchesFilter(it.params[0]) })
|
||||
UniqueTriggerActivation.triggerUnique(unique, unit, triggerNotificationText = triggerNotificationText)
|
||||
|
||||
if (unit.getResourceRequirementsPerTurn().isNotEmpty())
|
||||
civInfo.cache.updateCivResources()
|
||||
|
||||
for (unique in civInfo.getMatchingUniques(UniqueType.LandUnitsCrossTerrainAfterUnitGained)) {
|
||||
for (unique in civInfo.getMatchingUniques(UniqueType.LandUnitsCrossTerrainAfterUnitGained, unit.cache.state)) {
|
||||
if (unit.matchesFilter(unique.params[1])) {
|
||||
civInfo.passThroughImpassableUnlocked = true // Update the cached Boolean
|
||||
civInfo.passableImpassables.add(unique.params[0]) // Add to list of passable impassables
|
||||
|
Loading…
Reference in New Issue
Block a user