mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-24 18:06:04 +07:00
Fixed concurrent modification from triggers adding other triggers
This commit is contained in:
parent
802a206c53
commit
5263140911
@ -496,7 +496,7 @@ class Civilization : IsPartOfGameInfoSerialization {
|
|||||||
fun getTriggeredUniques(
|
fun getTriggeredUniques(
|
||||||
trigger: UniqueType,
|
trigger: UniqueType,
|
||||||
stateForConditionals: StateForConditionals = StateForConditionals(this)
|
stateForConditionals: StateForConditionals = StateForConditionals(this)
|
||||||
) : Sequence<Unique> = sequence {
|
) : Iterable<Unique> = sequence {
|
||||||
yieldAll(nation.uniqueMap.getTriggeredUniques(trigger, stateForConditionals))
|
yieldAll(nation.uniqueMap.getTriggeredUniques(trigger, stateForConditionals))
|
||||||
yieldAll(cities.asSequence()
|
yieldAll(cities.asSequence()
|
||||||
.flatMap { city -> city.cityConstructions.builtBuildingUniqueMap.getTriggeredUniques(trigger, stateForConditionals) }
|
.flatMap { city -> city.cityConstructions.builtBuildingUniqueMap.getTriggeredUniques(trigger, stateForConditionals) }
|
||||||
@ -509,7 +509,7 @@ class Civilization : IsPartOfGameInfoSerialization {
|
|||||||
yieldAll(tech.techUniques.getTriggeredUniques(trigger, stateForConditionals))
|
yieldAll(tech.techUniques.getTriggeredUniques(trigger, stateForConditionals))
|
||||||
yieldAll(getEra().uniqueMap.getTriggeredUniques (trigger, stateForConditionals))
|
yieldAll(getEra().uniqueMap.getTriggeredUniques (trigger, stateForConditionals))
|
||||||
yieldAll(gameInfo.ruleset.globalUniques.uniqueMap.getTriggeredUniques(trigger, stateForConditionals))
|
yieldAll(gameInfo.ruleset.globalUniques.uniqueMap.getTriggeredUniques(trigger, stateForConditionals))
|
||||||
}
|
}.toList() // Triggers can e.g. add buildings which contain triggers, causing concurrent modification errors
|
||||||
|
|
||||||
fun matchesFilter(filter: String): Boolean {
|
fun matchesFilter(filter: String): Boolean {
|
||||||
return MultiFilter.multiFilter(filter, ::matchesSingleFilter)
|
return MultiFilter.multiFilter(filter, ::matchesSingleFilter)
|
||||||
|
Loading…
Reference in New Issue
Block a user