Fix ConcurrentModificationException when puppeting a city (#9430)

This commit is contained in:
SomeTroglodyte
2023-05-22 19:12:31 +02:00
committed by GitHub
parent 5f60c887f7
commit b3166c4922

View File

@ -203,11 +203,9 @@ class CityPopulationManager : IsPartOfGameInfoSerialization {
}
// unassign specialists that cannot be (e.g. the city was captured and one of the specialist buildings was destroyed)
val maxSpecialists = getMaxSpecialists()
val specialistsHashmap = specialistAllocations
for ((specialistName, amount) in specialistsHashmap)
if (amount > maxSpecialists[specialistName])
specialistAllocations[specialistName] = maxSpecialists[specialistName]
for ((specialistName, maxAmount) in getMaxSpecialists())
if (specialistAllocations[specialistName] > maxAmount)
specialistAllocations[specialistName] = maxAmount
val localUniqueCache = LocalUniqueCache()