mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 21:30:20 +07:00
perf: Don't update civ stats on auto assign population
This commit is contained in:
@ -469,7 +469,9 @@ object UnitAutomation {
|
|||||||
// this can be sped up if we check each layer separately
|
// this can be sped up if we check each layer separately
|
||||||
val unitDistanceToTiles = unit.movement.getDistanceToTilesAtPosition(
|
val unitDistanceToTiles = unit.movement.getDistanceToTilesAtPosition(
|
||||||
unit.getTile().position,
|
unit.getTile().position,
|
||||||
unit.getMaxMovement() * CLOSE_ENEMY_TURNS_AWAY_LIMIT
|
unit.getMaxMovement() * CLOSE_ENEMY_TURNS_AWAY_LIMIT,
|
||||||
|
// Consider ZoC is expensive - we just want to find the closest, not the exact movement we'll need to get there
|
||||||
|
false,
|
||||||
)
|
)
|
||||||
var closeEnemies = TargetHelper.getAttackableEnemies(
|
var closeEnemies = TargetHelper.getAttackableEnemies(
|
||||||
unit,
|
unit,
|
||||||
|
@ -145,7 +145,7 @@ class CityPopulationManager : IsPartOfGameInfoSerialization {
|
|||||||
|
|
||||||
/** Only assigns free population */
|
/** Only assigns free population */
|
||||||
internal fun autoAssignPopulation() {
|
internal fun autoAssignPopulation() {
|
||||||
city.cityStats.update() // calculate current stats with current assignments
|
city.cityStats.update(updateCivStats = false) // calculate current stats with current assignments
|
||||||
val freePopulation = getFreePopulation()
|
val freePopulation = getFreePopulation()
|
||||||
if (freePopulation <= 0) return
|
if (freePopulation <= 0) return
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user