From 7918123a797dee0f54ee13f9799438bc45c13a6f Mon Sep 17 00:00:00 2001 From: SeventhM <127357473+SeventhM@users.noreply.github.com> Date: Mon, 16 Dec 2024 00:54:23 -0800 Subject: [PATCH] Use unit state for trigger conditionals for gaining new units (#12660) --- core/src/com/unciv/logic/civilization/managers/UnitManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/civilization/managers/UnitManager.kt b/core/src/com/unciv/logic/civilization/managers/UnitManager.kt index e2a148a061..0f55b4d6d1 100644 --- a/core/src/com/unciv/logic/civilization/managers/UnitManager.kt +++ b/core/src/com/unciv/logic/civilization/managers/UnitManager.kt @@ -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