]> git.mxchange.org Git - flightgear.git/commitdiff
Fix runway path appearance.
authorJames Turner <zakalawe@mac.com>
Sun, 21 Dec 2014 06:21:31 +0000 (09:21 +0300)
committerJames Turner <zakalawe@mac.com>
Sun, 21 Dec 2014 06:21:31 +0000 (09:21 +0300)
src/Navaids/routePath.cxx

index 4e29e349016764850ce69e369022d2286eaef1f0..f01bf7deb4fe0334402480ee60f87c0fb0ac0d8a 100644 (file)
@@ -742,25 +742,33 @@ void RoutePath::commonInit()
 
 SGGeodVec RoutePath::pathForIndex(int index) const
 {
+  const WayptData& w(d->waypoints[index]);
+  const std::string& ty(w.wpt->type());
+  SGGeodVec r;
   if (index == 0) {
-    return SGGeodVec(); // no path for first waypoint
+    // common case where we do want to show something for first waypoint
+    if (ty == "runway") {
+      FGRunway* rwy = static_cast<RunwayWaypt*>(w.wpt.get())->runway();
+      r.push_back(rwy->geod());
+      r.push_back(rwy->end());
+    }
+
+    return r;
   }
 
     if (d->waypoints[index].skipped) {
         return SGGeodVec();
     }
 
-  const WayptData& w(d->waypoints[index]);
-  const std::string& ty(w.wpt->type());
   if (ty == "vectors") {
-    return SGGeodVec(); // empty
+      // ideally we'd show a stippled line to connect the route?
+    return SGGeodVec();
   }
   
   if (ty== "hold") {
     return pathForHold((Hold*) d->waypoints[index].wpt.get());
   }
   
-  SGGeodVec r;
   const WayptData& prev(d->previousValidWaypoint(index));
   prev.turnExitPath(r);