mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 21:30:20 +07:00
Resolved #12426 - Don't allow triggers to decrease city population below 1
This commit is contained in:
@ -131,9 +131,9 @@ class CityPopulationManager : IsPartOfGameInfoSerialization {
|
|||||||
|
|
||||||
fun addPopulation(count: Int) {
|
fun addPopulation(count: Int) {
|
||||||
val changedAmount =
|
val changedAmount =
|
||||||
if (population + count < 0) -population
|
if (population + count < 1) 1 - population
|
||||||
else count
|
else count
|
||||||
population += changedAmount
|
population += count
|
||||||
val freePopulation = getFreePopulation()
|
val freePopulation = getFreePopulation()
|
||||||
if (freePopulation < 0) {
|
if (freePopulation < 0) {
|
||||||
unassignExtraPopulation()
|
unassignExtraPopulation()
|
||||||
|
Reference in New Issue
Block a user