diff --git a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt index 7997b13bb2..f3ac80b961 100644 --- a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt +++ b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt @@ -154,22 +154,22 @@ class BaseUnit : INamed, IConstruction { override fun postBuildEvent(construction: CityConstructions, wasBought: Boolean): Boolean { val unit = construction.cityInfo.civInfo.placeUnitNearTile(construction.cityInfo.location, name) - if(unit==null) return false // couldn't place the unit, so there's actually no unit =( - - if(this.unitType.isCivilian()) return true // tiny optimization makes save files a few bytes smaller - - var XP = construction.getBuiltBuildings().sumBy { it.xpForNewUnits } - if(construction.cityInfo.civInfo.policies.isAdopted("Total War")) XP += 15 - unit.promotions.XP = XP - - if(unit.type in listOf(UnitType.Melee,UnitType.Mounted,UnitType.Armor) - && construction.cityInfo.containsBuildingUnique("All newly-trained melee, mounted, and armored units in this city receive the Drill I promotion")) - unit.promotions.addPromotion("Drill I", isFree = true) + if (unit == null) return false // couldn't place the unit, so there's actually no unit =( //movement penalty - if(!unit.hasUnique("Can move directly once bought") && wasBought) + if (wasBought && !unit.hasUnique("Can move directly once bought")) unit.currentMovement = 0f + if (this.unitType.isCivilian()) return true // tiny optimization makes save files a few bytes smaller + + var XP = construction.getBuiltBuildings().sumBy { it.xpForNewUnits } + if (construction.cityInfo.civInfo.policies.isAdopted("Total War")) XP += 15 + unit.promotions.XP = XP + + if (unit.type in listOf(UnitType.Melee,UnitType.Mounted,UnitType.Armor) + && construction.cityInfo.containsBuildingUnique("All newly-trained melee, mounted, and armored units in this city receive the Drill I promotion")) + unit.promotions.addPromotion("Drill I", isFree = true) + return true }