]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/WaypointList.cxx
Continuous replay: use correct replay duration
[flightgear.git] / src / GUI / WaypointList.cxx
index b014d1cd3bc417c9a6ca4f1639c67fa8b12a02f0..4f9d68b13af2cecd50797d313752d6b4d1147f90 100644 (file)
@@ -83,9 +83,15 @@ public:
       --destIndex;
     }
     
+    unsigned int currentWpIndex = currentWaypoint();
     WayptRef w(_rm->removeWayptAtIndex(srcIndex));
     SG_LOG(SG_GENERAL, SG_INFO, "wpt:" << w->ident());
     _rm->insertWayptAtIndex(w, destIndex);
+
+    if (srcIndex == currentWpIndex) {
+        // current waypoint was moved
+        _rm->jumpToIndex(destIndex);
+    }
   }
   
   virtual void setUpdateCallback(SGCallback* cb)