mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 22:54:44 +07:00
Resolved #12611 - automated air units with "Cannot move" do not move
This commit is contained in:
parent
7187554adb
commit
d08f2a2939
@ -51,6 +51,8 @@ object AirUnitAutomation {
|
||||
|
||||
if (BattleHelper.tryAttackNearbyEnemy(unit)) return
|
||||
|
||||
if (unit.cache.cannotMove) return // from here on it's all "try to move somewhere else"
|
||||
|
||||
if (tryRelocateToCitiesWithEnemyNearBy(unit)) return
|
||||
|
||||
val pathsToCities = unit.movement.getAerialPathsToCities()
|
||||
@ -76,7 +78,6 @@ object AirUnitAutomation {
|
||||
|
||||
// no city needs fighters to defend, so let's attack stuff from the closest possible location
|
||||
tryMoveToCitiesToAerialAttackFrom(pathsToCities, unit)
|
||||
|
||||
}
|
||||
|
||||
private fun tryAirSweep(unit: MapUnit, tilesWithEnemyUnitsInRange: List<Tile>): Boolean {
|
||||
@ -97,6 +98,8 @@ object AirUnitAutomation {
|
||||
return // Wait and heal
|
||||
}
|
||||
|
||||
if (unit.cache.cannotMove) return // from here on it's all "try to move somewhere else"
|
||||
|
||||
if (tryRelocateToCitiesWithEnemyNearBy(unit)) return
|
||||
|
||||
val pathsToCities = unit.movement.getAerialPathsToCities()
|
||||
|
Loading…
Reference in New Issue
Block a user