From 54759f1f948370b78fceffdc949288c6d797c9f9 Mon Sep 17 00:00:00 2001 From: Druss99 <42724070+Druss99@users.noreply.github.com> Date: Sun, 9 Nov 2025 21:49:39 -0500 Subject: [PATCH] Fixed bugs wrt planning escort flights (#612) --- changelog.md | 2 +- game/ato/flightplans/escort.py | 8 +++++++- qt_ui/windows/mission/QPackageDialog.py | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 6afbd7c0..d26ac497 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/game/ato/flightplans/escort.py b/game/ato/flightplans/escort.py index a9ea79d5..3263f78a 100644 --- a/game/ato/flightplans/escort.py +++ b/game/ato/flightplans/escort.py @@ -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 diff --git a/qt_ui/windows/mission/QPackageDialog.py b/qt_ui/windows/mission/QPackageDialog.py index 09117f26..0d92c037 100644 --- a/qt_ui/windows/mission/QPackageDialog.py +++ b/qt_ui/windows/mission/QPackageDialog.py @@ -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",