mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 05:41:11 +07:00
Fixed bug where effects of all aquaducts nationwide stacked in each city (#4487)
* Fixed bug where effects of all aquaducts nationwide stacked in each city * Implemented requested changes * Implemented requested changes better
This commit is contained in:
@ -60,9 +60,15 @@ class PopulationManager {
|
||||
if (foodStored >= getFoodToNextPopulation()) { // growth!
|
||||
foodStored -= getFoodToNextPopulation()
|
||||
var percentOfFoodCarriedOver = cityInfo
|
||||
.getMatchingUniques("[]% of food is carried over after population increases")
|
||||
.getMatchingUniques("[]% of food is carried over [] after population increases")
|
||||
.filter { cityInfo.matchesFilter(it.params[1]) }
|
||||
.sumBy { it.params[0].toInt() }
|
||||
// Deprecated since 3.15.11
|
||||
percentOfFoodCarriedOver += cityInfo
|
||||
.getLocalMatchingUniques("[]% of food is carried over after population increases")
|
||||
.sumBy { it.params[0].toInt() }
|
||||
// Try to avoid runaway food gain in mods, just in case mod makes don't notice it
|
||||
//
|
||||
// Try to avoid runaway food gain in mods, just in case
|
||||
if (percentOfFoodCarriedOver > 95) percentOfFoodCarriedOver = 95
|
||||
foodStored += (getFoodToNextPopulation() * percentOfFoodCarriedOver / 100f).toInt()
|
||||
population++
|
||||
|
Reference in New Issue
Block a user