diff --git a/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt index 3a155dab85..da2da49cab 100644 --- a/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt @@ -293,7 +293,9 @@ object NextTurnAutomation { } private fun useGoldForCityStates(civ: Civilization) { - val knownCityStates = civ.getKnownCivs().filter { it.isCityState() } + // RARE EDGE CASE: If you ally with a city-state, you may reveal more map that includes ANOTHER civ! + // So if we don't lock this list, we may later discover that there are more known civs, concurrent modification exception! + val knownCityStates = civ.getKnownCivs().filter { it.isCityState() }.toList() // canBeMarriedBy checks actual cost, but it can't be below 500*speedmodifier, and the later check is expensive if (civ.gold >= 330 && civ.getHappiness() > 0 && civ.hasUnique(UniqueType.CityStateCanBeBoughtForGold)) {