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
3 changed files with 10 additions and 2 deletions

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