mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-27 08:09:21 +07:00
Civilian should not move when bought (#2621)
* Civilian cannot move when bought same as military unit * Minor code restyling
This commit is contained in:
@ -156,6 +156,10 @@ class BaseUnit : INamed, IConstruction {
|
||||
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 =(
|
||||
|
||||
//movement penalty
|
||||
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 }
|
||||
@ -166,10 +170,6 @@ class BaseUnit : INamed, IConstruction {
|
||||
&& 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)
|
||||
|
||||
//movement penalty
|
||||
if(!unit.hasUnique("Can move directly once bought") && wasBought)
|
||||
unit.currentMovement = 0f
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user