mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Move units out of cities when liberating
This commit is contained in:
parent
05ae6fc81f
commit
bc458c72ff
@ -153,9 +153,7 @@ object BattleDamage {
|
||||
if (defender is CityCombatant &&
|
||||
attacker.getCivInfo().containsBuildingUnique("+15% Combat Strength for all units when attacking Cities"))
|
||||
modifiers["Statue of Zeus"] = 0.15f
|
||||
}
|
||||
|
||||
else if (attacker is CityCombatant) {
|
||||
} else if (attacker is CityCombatant) {
|
||||
if (policies.hasEffect("Units in cities cost no Maintenance, garrisoned city +50% attacking strength")
|
||||
&& attacker.city.getCenterTile().militaryUnit != null)
|
||||
modifiers["Oligarchy"] = 0.5f
|
||||
|
@ -450,6 +450,12 @@ class CityInfo {
|
||||
if(foundingCiv.cities.size == 1) cityConstructions.addBuilding("Palace") // Resurrection!
|
||||
isPuppet = false
|
||||
cityStats.update()
|
||||
|
||||
// Move units out of the city when liberated
|
||||
for(unit in getTiles().flatMap { it.getUnits() }.toList())
|
||||
if(!unit.movement.canPassThrough(unit.currentTile))
|
||||
unit.movement.teleportToClosestMoveableTile()
|
||||
|
||||
UncivGame.Current.worldScreen.shouldUpdate=true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user