Fixed bugs wrt planning escort flights (#612)

This commit is contained in:
Druss99 2025-11-09 21:49:39 -05:00 committed by GitHub
parent 0fcf308079
commit 54759f1f94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View File

@ -22,7 +22,7 @@
* **[AirWing]** Use aircraft display names for easier differentiation between modules
## Fixes
* **[Flight Plans]** Fixed a bug when a package was created with only escort flights
* **[Flight Plans]** Fixed bugs wrt planning escort flights
* **[Flight Plans]** Added AntiShipStrike as a fallback task for OCA/Aircraft to fix a bug where the S-3B could not do OCA/Aircraft
* **[Squadrons]** Fixed a bug where loading an air wing config would not properly load all squadrons
* **[Flight Plans]** Fixed a bug where SEAD flights would fire one ARM and RTB

View File

@ -23,7 +23,13 @@ class EscortFlightPlan(FormationAttackFlightPlan):
@property
def split_time(self) -> datetime:
if self.package.primary_flight and self.package.primary_flight.flight_plan:
# Avoid infinite recursion when this escort flight is itself the primary flight
# This can happen when only escort flights remain in a package
if (
self.package.primary_flight
and self.package.primary_flight != self.flight
and self.package.primary_flight.flight_plan
):
return self.package.primary_flight.flight_plan.mission_departure_time
else:
return super().split_time

View File

@ -298,6 +298,8 @@ class QPackageDialog(QDialog):
):
return True
else:
for flight in list(self.package_model.package.flights):
self.package_model.cancel_or_abort_flight(flight)
QMessageBox.critical(
self,
"Invalid Package",