Avoid crash from "remove building in this city" uniques when not applied in the context of a city - see #13348

This commit is contained in:
yairm210 2025-05-25 18:41:51 +03:00
parent 19876c97ed
commit 325b8dcc38

View File

@ -945,7 +945,7 @@ object UniqueTriggerActivation {
UniqueType.RemoveBuilding -> {
val applicableCities =
if (unique.params[1] == "in this city") sequenceOf(relevantCity!!)
if (unique.params[1] == "in this city") if (relevantCity == null) emptySequence() else sequenceOf(relevantCity!!)
else civInfo.cities.asSequence().filter { it.matchesFilter(unique.params[1]) }
if (applicableCities.none()) return null