Fix parameter mapping for UnitSupplyPerPop (#11859)

This commit is contained in:
SomeTroglodyte 2024-07-17 14:36:56 +02:00 committed by GitHub
parent 2871fa855d
commit ce25cbf787
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -149,8 +149,8 @@ class CivInfoStatsForNextTurn(val civInfo: Civilization) {
for (unique in civInfo.getMatchingUniques(UniqueType.UnitSupplyPerPop)) {
val applicablePopulation = civInfo.cities
.filter { it.matchesFilter(unique.params[1]) }
.sumOf { it.population.population }
.filter { it.matchesFilter(unique.params[2]) }
.sumOf { it.population.population / unique.params[1].toInt() }
totalSupply += unique.params[0].toDouble() * applicablePopulation
}
return totalSupply.toInt()