From 2a29dd4886b9b5f31fa15a2ab77549cb9e355f41 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 13 Jul 2023 20:24:51 -0700 Subject: [PATCH] Fix off-by-one error in waypoint deletion. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/3067. --- changelog.md | 1 + qt_ui/windows/mission/flight/waypoints/QFlightWaypointTab.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 2e71081d..1ae61dbe 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,7 @@ Saves from 8.x are not compatible with 9.0.0. * **[Data]** Allow CH-47D, CH-53E and UH-60A to operate from carriers and LHAs. * **[Mission Generation]** Restored previous AI behavior for anti-ship missions. A DCS update caused only a single aircraft in a flight to attack. The full flight will now attack like they used to. * **[Plugins]** Fixed Lua errors in Skynet plugin that would occur whenever one coalition had no IADS nodes. +* **[UI]** Fixed deleting waypoints in custom flight plans deleting the wrong waypoint. # 8.1.0 diff --git a/qt_ui/windows/mission/flight/waypoints/QFlightWaypointTab.py b/qt_ui/windows/mission/flight/waypoints/QFlightWaypointTab.py index 14216b86..30d380ee 100644 --- a/qt_ui/windows/mission/flight/waypoints/QFlightWaypointTab.py +++ b/qt_ui/windows/mission/flight/waypoints/QFlightWaypointTab.py @@ -101,7 +101,9 @@ class QFlightWaypointTab(QFrame): selection = self.flight_waypoint_list.selectionModel() for selected_row in selection.selectedIndexes(): 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() + 1] + ) for waypoint in waypoints: self.delete_waypoint(waypoint) self.flight_waypoint_list.update_list()