mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 15:27:50 +07:00
Fixes bug where upgrading units would no longer provide their default upgrades (#4948)
This commit is contained in:
@ -229,6 +229,10 @@ class MapUnit {
|
||||
newUnit.currentMovement = currentMovement
|
||||
newUnit.attacksThisTurn = attacksThisTurn
|
||||
newUnit.isTransported = isTransported
|
||||
for (promotion in newUnit.promotions.promotions)
|
||||
if (promotion !in promotions.promotions)
|
||||
promotions.addPromotion(promotion, isFree = true)
|
||||
|
||||
newUnit.promotions = promotions.clone()
|
||||
|
||||
newUnit.updateUniques()
|
||||
@ -723,7 +727,7 @@ class MapUnit {
|
||||
fun removeFromTile() = currentTile.removeUnit(this)
|
||||
|
||||
fun moveThroughTile(tile: TileInfo) {
|
||||
// addPromotion requires currentTile to be valid because it accesses ruleset through it
|
||||
// addPromotion requires currentTile to be valid because it accesses ruleset through it.
|
||||
// getAncientRuinBonus, if it places a new unit, does too
|
||||
currentTile = tile
|
||||
|
||||
|
Reference in New Issue
Block a user