]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIFlightPlanCreateCruise.cxx
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / AIModel / AIFlightPlanCreateCruise.cxx
index 05f80c89a7ff9c4d125b09124d92d7f2b2306c33..898e7ef5d3b090f15ac67283623a0053989eeb2b 100644 (file)
@@ -292,14 +292,15 @@ bool FGAIFlightPlan::createCruise(FGAIAircraft *ac, bool firstFlight, FGAirport
                                  double alt, const string& fltType)
 {
   double vCruise = ac->getPerformance()->vCruise();
-  waypoint *wpt;
+  FGAIWaypoint *wpt;
   wpt = createInAir(ac, "Cruise", SGGeod::fromDeg(longitude, latitude), alt, vCruise);
   waypoints.push_back(wpt); 
   
   string rwyClass = getRunwayClassFromTrafficType(fltType);
   double heading = ac->getTrafficRef()->getCourse();
   arr->getDynamics()->getActiveRunway(rwyClass, 2, activeRunway, heading);
-  rwy = arr->getRunwayByIdent(activeRunway);
+  FGRunway* rwy = arr->getRunwayByIdent(activeRunway);
+  assert( rwy != NULL );
   // begin descent 110km out
   SGGeod beginDescentPoint     = rwy->pointOnCenterline(0);
   SGGeod secondaryDescentPoint = rwy->pointOnCenterline(-10000);
@@ -308,4 +309,5 @@ bool FGAIFlightPlan::createCruise(FGAIAircraft *ac, bool firstFlight, FGAirport
   waypoints.push_back(wpt); 
   wpt = createInAir(ac, "BOD2", secondaryDescentPoint, alt, vCruise);
   waypoints.push_back(wpt); 
+  return true;
 }