mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-30 14:48:56 +07:00
perf: Don't update city stats at *end turn* when unassigning extra population (won't affect anything until next turn where we'll recalc anyway)
This commit is contained in:
@ -411,8 +411,7 @@ class City : IsPartOfGameInfoSerialization, INamed {
|
||||
hasSoldBuildingThisTurn = true
|
||||
|
||||
population.unassignExtraPopulation() // If the building provided specialists, release them to other work
|
||||
population.autoAssignPopulation()
|
||||
cityStats.update()
|
||||
population.autoAssignPopulation() // also updates city stats
|
||||
civ.cache.updateCivResources() // this building could be a resource-requiring one
|
||||
}
|
||||
|
||||
|
@ -131,6 +131,7 @@ class CityPopulationManager : IsPartOfGameInfoSerialization {
|
||||
val freePopulation = getFreePopulation()
|
||||
if (freePopulation < 0) {
|
||||
unassignExtraPopulation()
|
||||
city.cityStats.update()
|
||||
} else {
|
||||
autoAssignPopulation()
|
||||
}
|
||||
@ -267,8 +268,6 @@ class CityPopulationManager : IsPartOfGameInfoSerialization {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
city.cityStats.update()
|
||||
}
|
||||
|
||||
fun getMaxSpecialists(): Counter<String> {
|
||||
|
@ -536,7 +536,7 @@ class Civilization : IsPartOfGameInfoSerialization {
|
||||
yieldAll(religionManager.religion!!.founderBeliefUniqueMap.getMatchingUniques(uniqueType, stateForConditionals))
|
||||
|
||||
yieldAll(getCivResourceSupply().asSequence()
|
||||
.filter { it.amount > 0 }
|
||||
.filter { it.amount > 0 && it.resource.uniques.isNotEmpty() }
|
||||
.flatMap { it.resource.getMatchingUniques(uniqueType, stateForConditionals) }
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user