Resolved #12426 - Don't allow triggers to decrease city population below 1

This commit is contained in:
yairm210 2024-11-07 13:06:40 +02:00
parent aa59be298b
commit 0ea175573f

View File

@ -131,9 +131,9 @@ class CityPopulationManager : IsPartOfGameInfoSerialization {
fun addPopulation(count: Int) {
val changedAmount =
if (population + count < 0) -population
if (population + count < 1) 1 - population
else count
population += changedAmount
population += count
val freePopulation = getFreePopulation()
if (freePopulation < 0) {
unassignExtraPopulation()