Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't return available destinations when retreating aircraft if the runway is not operational #3435

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading