Avoid recreating flight-plan when syncing package wpts

This commit is contained in:
Raffson 2024-11-24 17:44:01 +01:00
parent 5e2f86de96
commit 98f0c93012
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -102,8 +102,18 @@ def update_package_waypoints_if_primary_flight(
wpts.initial = wpts.get_initial_point(
waypoint.position, flight.package.target.position
)
else:
return
for f in flight.package.flights:
if f is flight:
continue
f.recreate_flight_plan()
events.update_flight(f)
for wpt in f.flight_plan.iter_waypoints():
if wpt.waypoint_type == waypoint.waypoint_type or (
"INGRESS" in wpt.waypoint_type.name
and "INGRESS" in waypoint.waypoint_type.name
):
wpt.position = waypoint.position.new_in_same_map(
waypoint.position.x, waypoint.position.y
)
events.update_flight(f)
break