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

Short circuits selecting control points to retreat aircraft to when the
control point being captured has a damaged runway.

Fixes #3434. 

I'm not sure how to test this locally though, so I have no idea if it
works.
This commit is contained in:
Geoff Franks 2024-09-08 01:10:00 -04:00 committed by GitHub
parent db5af55c49
commit ad328334db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -764,6 +764,9 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
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