mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 22:54:44 +07:00
Resolved #12426 - Don't allow triggers to decrease city population below 1
This commit is contained in:
parent
aa59be298b
commit
0ea175573f
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user