mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 20:59:18 +07:00
Resolve #11795 - fix performance problem for displaying air units in cities
This commit is contained in:
@ -155,7 +155,6 @@ class RoadBetweenCitiesAutomation(val civInfo: Civilization, cachedForTurn: Int,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
workerUnit.destroy()
|
|
||||||
roadsToBuildByCitiesCache[city] = roadsToBuild
|
roadsToBuildByCitiesCache[city] = roadsToBuild
|
||||||
return roadsToBuild
|
return roadsToBuild
|
||||||
}
|
}
|
||||||
|
@ -13,11 +13,11 @@ import com.unciv.models.ruleset.RejectionReason
|
|||||||
import com.unciv.models.ruleset.RejectionReasonType
|
import com.unciv.models.ruleset.RejectionReasonType
|
||||||
import com.unciv.models.ruleset.Ruleset
|
import com.unciv.models.ruleset.Ruleset
|
||||||
import com.unciv.models.ruleset.RulesetObject
|
import com.unciv.models.ruleset.RulesetObject
|
||||||
|
import com.unciv.models.ruleset.unique.Conditionals
|
||||||
import com.unciv.models.ruleset.unique.StateForConditionals
|
import com.unciv.models.ruleset.unique.StateForConditionals
|
||||||
import com.unciv.models.ruleset.unique.Unique
|
import com.unciv.models.ruleset.unique.Unique
|
||||||
import com.unciv.models.ruleset.unique.UniqueTarget
|
import com.unciv.models.ruleset.unique.UniqueTarget
|
||||||
import com.unciv.models.ruleset.unique.UniqueType
|
import com.unciv.models.ruleset.unique.UniqueType
|
||||||
import com.unciv.models.ruleset.unique.Conditionals
|
|
||||||
import com.unciv.models.stats.Stat
|
import com.unciv.models.stats.Stat
|
||||||
import com.unciv.ui.components.extensions.getNeedMoreAmountString
|
import com.unciv.ui.components.extensions.getNeedMoreAmountString
|
||||||
import com.unciv.ui.components.extensions.toPercent
|
import com.unciv.ui.components.extensions.toPercent
|
||||||
@ -194,11 +194,11 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
|||||||
|
|
||||||
// Expensive, since adding and removing the fake unit causes side-effects
|
// Expensive, since adding and removing the fake unit causes side-effects
|
||||||
if (isAirUnit()) {
|
if (isAirUnit()) {
|
||||||
|
// Not actually added to civ so doesn't require destroy
|
||||||
val fakeUnit = getMapUnit(cityConstructions.city.civ, Constants.NO_ID)
|
val fakeUnit = getMapUnit(cityConstructions.city.civ, Constants.NO_ID)
|
||||||
val canUnitEnterTile = fakeUnit.movement.canMoveTo(cityConstructions.city.getCenterTile())
|
val canUnitEnterTile = fakeUnit.movement.canMoveTo(cityConstructions.city.getCenterTile())
|
||||||
if (!canUnitEnterTile)
|
if (!canUnitEnterTile)
|
||||||
yield(RejectionReasonType.NoPlaceToPutUnit.toInstance())
|
yield(RejectionReasonType.NoPlaceToPutUnit.toInstance())
|
||||||
fakeUnit.destroy()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1927,6 +1927,7 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
|||||||
Modifiers that can be added to other uniques to limit when they will be active
|
Modifiers that can be added to other uniques to limit when they will be active
|
||||||
|
|
||||||
??? example "<for [amount] turns>"
|
??? example "<for [amount] turns>"
|
||||||
|
Turns this unique into a trigger, activating this unique as a *global* unique for a number of turns
|
||||||
Example: "<for [3] turns>"
|
Example: "<for [3] turns>"
|
||||||
|
|
||||||
Applicable to: Conditional
|
Applicable to: Conditional
|
||||||
@ -2113,18 +2114,21 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
|||||||
Applicable to: Conditional
|
Applicable to: Conditional
|
||||||
|
|
||||||
??? example "<when above [amount] [stat/resource]>"
|
??? example "<when above [amount] [stat/resource]>"
|
||||||
|
Stats refers to the accumulated stat, not stat-per-turn
|
||||||
Example: "<when above [3] [Culture]>"
|
Example: "<when above [3] [Culture]>"
|
||||||
|
|
||||||
This unique's effect can be modified with <(modified by game speed)>
|
This unique's effect can be modified with <(modified by game speed)>
|
||||||
Applicable to: Conditional
|
Applicable to: Conditional
|
||||||
|
|
||||||
??? example "<when below [amount] [stat/resource]>"
|
??? example "<when below [amount] [stat/resource]>"
|
||||||
|
Stats refers to the accumulated stat, not stat-per-turn
|
||||||
Example: "<when below [3] [Culture]>"
|
Example: "<when below [3] [Culture]>"
|
||||||
|
|
||||||
This unique's effect can be modified with <(modified by game speed)>
|
This unique's effect can be modified with <(modified by game speed)>
|
||||||
Applicable to: Conditional
|
Applicable to: Conditional
|
||||||
|
|
||||||
??? example "<when between [amount] and [amount] [stat/resource]>"
|
??? example "<when between [amount] and [amount] [stat/resource]>"
|
||||||
|
Stats refers to the accumulated stat, not stat-per-turn
|
||||||
Example: "<when between [3] and [3] [Culture]>"
|
Example: "<when between [3] and [3] [Culture]>"
|
||||||
|
|
||||||
This unique's effect can be modified with <(modified by game speed)>
|
This unique's effect can be modified with <(modified by game speed)>
|
||||||
|
Reference in New Issue
Block a user