From: James Turner Date: Fri, 21 Sep 2012 11:47:51 +0000 (+0100) Subject: Fix a stupid logic bug when re-ordering waypoints. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d7d19649aa74c9a7b808dac969f03cd0a5e6d7f0;p=flightgear.git Fix a stupid logic bug when re-ordering waypoints. http://code.google.com/p/flightgear-bugs/issues/detail?id=870 --- 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) {