]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/route_mgr.cxx
Fix bug 191, uninitialised HUD color.
[flightgear.git] / src / Autopilot / route_mgr.cxx
index 1896946fce76c7a2ccd37909cd3d7c8ff2563773..c0f8f26318f33315e505199b9892e8b0855f2344 100644 (file)
@@ -237,7 +237,7 @@ void FGRouteMgr::postinit()
     SG_LOG(SG_AUTOPILOT, SG_INFO, "loaded initial waypoints:" << _route.size());
   }
 
-  weightOnWheels = fgGetNode("/gear/gear[0]/wow", false);
+  weightOnWheels = fgGetNode("/gear/gear[0]/wow", true);
   // check airbone flag agrees with presets
 }
 
@@ -468,7 +468,7 @@ void FGRouteMgr::autoRoute()
     
   _route.clear(); // clear out the existing, first
 // SID
-  SID* sid;
+  flightgear::SID* sid;
   WayptRef sidTrans;
   
   boost::tie(sid, sidTrans) = _departure->selectSID(_destination->geod(), runway);
@@ -569,7 +569,7 @@ void FGRouteMgr::buildDeparture(WayptRef enroute, WayptVec& wps)
   
   FGRunway* r = _departure->getRunwayByIdent(runwayId);
   string sidId = departure->getStringValue("sid");
-  SID* sid = _departure->findSIDWithIdent(sidId);
+  flightgear::SID* sid = _departure->findSIDWithIdent(sidId);
   if (!sid) {
 // valid runway, but no SID selected/found, so just the runway node for now
     if (!sidId.empty() && (sidId != "(none)")) {
@@ -673,7 +673,7 @@ void FGRouteMgr::insertWayptAtIndex(Waypt* aWpt, int aIndex)
   }
   
   int index = aIndex;
-  if ((aIndex == -1) || (aIndex > _route.size())) {
+  if ((aIndex == -1) || (aIndex > (int) _route.size())) {
     index = _route.size();
   }
   
@@ -1027,7 +1027,7 @@ void FGRouteMgr::jumpToIndex(int index)
 
 void FGRouteMgr::currentWaypointChanged()
 {
-  Waypt* cur = currentWaypt();
+  Waypt* cur = (_currentIndex<numWaypts()) ? currentWaypt() : NULL;
   Waypt* next = nextWaypt();
 
   wp0->getChild("id")->setStringValue(cur ? cur->ident() : "");