diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 20814c0d21..26e18224f7 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -161,7 +161,7 @@ class CityInfo { expansion.nextTurn(stats.culture) if(isBeingRazed){ population.population-- - if(population.population==0){ + if(population.population<=0){ // there are strange cases where we geet to -1 civInfo.addNotification("$name {has been razed to the ground}!",location, Color.RED) destroyCity() if(isCapital() && civInfo.cities.isNotEmpty()) // Yes, we actually razed the capital. Some people do this. @@ -170,8 +170,10 @@ class CityInfo { } else population.nextTurn(stats.food) - health = min(health+20, getMaxHealth()) - population.unassignExtraPopulation() + if(this in civInfo.cities) { // city was not destroyed + health = min(health + 20, getMaxHealth()) + population.unassignExtraPopulation() + } } fun destroyCity() { diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index 9fef02290e..f1a7789ada 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -131,6 +131,8 @@ class CityStats { val happinessFromBuildings = cityInfo.cityConstructions.getStats().happiness.toInt().toFloat() newHappinessList ["Buildings"] = happinessFromBuildings + // we don't want to modify the existing happiness list because that leads + // to concurrency problems if we iterate on it while changing happinessList=newHappinessList return newHappinessList }