]> 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 d5411b8af7d73960644590d5d37714e423d007f4..c0f8f26318f33315e505199b9892e8b0855f2344 100644 (file)
@@ -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() : "");