Skip to content

Commit

Permalink
modding: Resolved #12392 - "upon building a [improvementFilter] impro…
Browse files Browse the repository at this point in the history
…vement" triggers correctly
  • Loading branch information
yairm210 committed Nov 1, 2024
1 parent ec6e13c commit 0b7b962
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/src/com/unciv/logic/map/tile/TileImprovementFunctions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,18 @@ class TileImprovementFunctions(val tile: Tile) {
UniqueTriggerActivation.triggerUnique(unique, civ, unit = unit, tile = tile)

for (unique in civ.getTriggeredUniques(UniqueType.TriggerUponBuildingImprovement, stateForConditionals)
.filter { improvement.matchesFilter(it.params[0]) })
.filter {
it.getModifiers(UniqueType.TriggerUponBuildingImprovement).any {
improvement.matchesFilter(it.params[0])
} })
UniqueTriggerActivation.triggerUnique(unique, civ, unit = unit, tile = tile)

if (unit == null) return
for (unique in unit.getTriggeredUniques(UniqueType.TriggerUponBuildingImprovement, stateForConditionals)
.filter { improvement.matchesFilter(it.params[0]) })
.filter {
it.getModifiers(UniqueType.TriggerUponBuildingImprovement).any {
improvement.matchesFilter(it.params[0])
} })
UniqueTriggerActivation.triggerUnique(unique, civ, unit = unit, tile = tile)
}

Expand Down

0 comments on commit 0b7b962

Please sign in to comment.