Clearer pop change limit

This commit is contained in:
yairm210 2024-11-08 07:06:21 +02:00
parent c87ed50a98
commit 92fd488301

View File

@ -130,10 +130,8 @@ class CityPopulationManager : IsPartOfGameInfoSerialization {
}
fun addPopulation(count: Int) {
val changedAmount =
if (population + count < 1) 1 - population
else count
population += count
val changedAmount = count.coerceAtMost(population - 1)
population += changedAmount
val freePopulation = getFreePopulation()
if (freePopulation < 0) {
unassignExtraPopulation()