diff --git a/src/GUI/WaypointList.cxx b/src/GUI/WaypointList.cxx index e8e5b36dc..967b3496c 100644 --- a/src/GUI/WaypointList.cxx +++ b/src/GUI/WaypointList.cxx @@ -90,11 +90,10 @@ public: --destIndex; } - unsigned int currentWpIndex = currentWaypoint(); - WayptRef w(waypointAt(currentWpIndex)); - _fp->deleteIndex(currentWpIndex); + int currentWpIndex = currentWaypoint(); - SG_LOG(SG_GENERAL, SG_INFO, "wpt:" << w->ident()); + WayptRef w = _fp->legAtIndex(srcIndex)->waypoint(); + _fp->deleteIndex(srcIndex); _fp->insertWayptAtIndex(w, destIndex); if (srcIndex == currentWpIndex) {