]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a stupid logic bug when re-ordering waypoints.
authorJames Turner <zakalawe@mac.com>
Fri, 21 Sep 2012 11:47:51 +0000 (12:47 +0100)
committerJames Turner <zakalawe@mac.com>
Fri, 21 Sep 2012 11:47:51 +0000 (12:47 +0100)
http://code.google.com/p/flightgear-bugs/issues/detail?id=870

src/GUI/WaypointList.cxx

index e8e5b36dcb40e2625d1225095519182884e225f1..967b3496cc76f10d9a5025c0ccc5aa7a6bfcc464 100644 (file)
@@ -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) {