mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 17:59:11 +07:00
Growth nullifying uniques do not nullify starvation
This commit is contained in:
@ -589,12 +589,13 @@ class CityStats(val city: City) {
|
|||||||
|
|
||||||
val growthNullifyingUnique = city.getMatchingUniques(UniqueType.NullifiesGrowth).firstOrNull()
|
val growthNullifyingUnique = city.getMatchingUniques(UniqueType.NullifiesGrowth).firstOrNull()
|
||||||
if (growthNullifyingUnique != null) {
|
if (growthNullifyingUnique != null) {
|
||||||
// Note that negative food will also be nullified. Pretty sure that's conform civ V, but haven't checked.
|
// Does not nullify negative growth (starvation)
|
||||||
val amountToRemove = -newFinalStatList.values.sumOf { it[Stat.Food].toDouble() }
|
val currentGrowth = newFinalStatList.values.sumOf { it[Stat.Food].toDouble() }
|
||||||
newFinalStatList.add(
|
if (currentGrowth > 0)
|
||||||
growthNullifyingUnique.getSourceNameForUser(),
|
newFinalStatList.add(
|
||||||
Stats(food = amountToRemove.toFloat())
|
growthNullifyingUnique.getSourceNameForUser(),
|
||||||
)
|
Stats(food = -currentGrowth.toFloat())
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (city.isInResistance())
|
if (city.isInResistance())
|
||||||
|
Reference in New Issue
Block a user