Skip to content

Commit

Permalink
Don't return available destinations when retreating aircraft if the r…
Browse files Browse the repository at this point in the history
…unway is not operational
  • Loading branch information
geofffranks committed Sep 7, 2024
1 parent 8237b15 commit 7931260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Saves from 11.x are not compatible with 12.0.0.

* **[Campaign]** Removed deprecated settings for generating persistent and invulnerable AWACs and tankers.
* **[Mods]** F/A-18 E/F/G Super Hornet mod version updated to 2.3.
* **[Campaign]** Do not allow aircraft from a captured control point to retreat if the captured control point has a damaged runway.

## Fixes

Expand Down
3 changes: 3 additions & 0 deletions game/theater/controlpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,9 @@ def capture_aircraft(self, game: Game, airframe: AircraftType, count: int) -> No
def aircraft_retreat_destination(
self, squadron: Squadron
) -> Optional[ControlPoint]:
if not self.runway_is_operational():
return None

closest = ObjectiveDistanceCache.get_closest_airfields(self)
max_retreat_distance = squadron.aircraft.max_mission_range
# Skip the first airbase because that's the airbase we're retreating
Expand Down

0 comments on commit 7931260

Please sign in to comment.