mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix Exception: 'DeadFlightPlan' object has no attribute 'targets'
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2247
This commit is contained in:
parent
70e5c578ae
commit
c5ff8777be
@ -98,9 +98,8 @@ class QFlightWaypointTab(QFrame):
|
|||||||
|
|
||||||
def on_delete_waypoint(self):
|
def on_delete_waypoint(self):
|
||||||
waypoints = []
|
waypoints = []
|
||||||
for (
|
selection = self.flight_waypoint_list.selectionModel()
|
||||||
selected_row
|
for selected_row in selection.selectedIndexes():
|
||||||
) in self.flight_waypoint_list.selectionModel().selectedIndexes():
|
|
||||||
if selected_row.row() > 0:
|
if selected_row.row() > 0:
|
||||||
waypoints.append(self.flight.flight_plan.waypoints[selected_row.row()])
|
waypoints.append(self.flight.flight_plan.waypoints[selected_row.row()])
|
||||||
for waypoint in waypoints:
|
for waypoint in waypoints:
|
||||||
@ -113,9 +112,10 @@ class QFlightWaypointTab(QFrame):
|
|||||||
# If the waypoint is a target waypoint and is not the last target
|
# If the waypoint is a target waypoint and is not the last target
|
||||||
# waypoint, we don't need to degrade.
|
# waypoint, we don't need to degrade.
|
||||||
if isinstance(self.flight.flight_plan, FormationAttackFlightPlan):
|
if isinstance(self.flight.flight_plan, FormationAttackFlightPlan):
|
||||||
is_target = waypoint in self.flight.flight_plan.targets
|
is_target = waypoint in self.flight.flight_plan.target_area_waypoint.targets
|
||||||
if is_target and len(self.flight.flight_plan.targets) > 1:
|
count = len(self.flight.flight_plan.target_area_waypoint.targets)
|
||||||
self.flight.flight_plan.targets.remove(waypoint)
|
if is_target and count > 1:
|
||||||
|
self.flight.flight_plan.target_area_waypoint.targets.remove(waypoint)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.degrade_to_custom_flight_plan()
|
self.degrade_to_custom_flight_plan()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user