mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Make TOT waypoints non-optional for flight plans.
Flights without a meaningful TOT make the code around startup time (and other scheduling behaviors) unnecessarily complicated because they have to handle unpredictable flight plans. We can simplify this by requiring that all flight plans have a waypoint associated with their TOT. For custom flight plans, we can just fall back to the takeoff waypoint. For RTB flight plans (which are only synthetic flight plans injected for aborted flights), we can use the abort point. This also means that all flight plans now have, at the very least, a departure waypoint. Deleting this waypoint is invalid even for custom flights, so that's no a problem.
This commit is contained in:
@@ -148,7 +148,12 @@ class QFlightWaypointTab(QFrame):
|
||||
if not isinstance(self.flight.flight_plan, CustomFlightPlan):
|
||||
self.flight.flight_plan = CustomFlightPlan(
|
||||
self.flight,
|
||||
CustomLayout(custom_waypoints=self.flight.flight_plan.waypoints),
|
||||
CustomLayout(
|
||||
departure=WaypointBuilder(self.flight, self.coalition).takeoff(
|
||||
self.flight.departure
|
||||
),
|
||||
custom_waypoints=self.flight.flight_plan.waypoints[1:],
|
||||
),
|
||||
)
|
||||
|
||||
def confirm_recreate(self, task: FlightType) -> None:
|
||||
|
||||
Reference in New Issue
Block a user