]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIFlightPlan.cxx
Make the sound-manager optional in a few places.
[flightgear.git] / src / AIModel / AIFlightPlan.cxx
index e552f05e071347430a58c0b5e97dfe36e957289b..f8f7c57636f3ec39f3de1265df69c719021480ef 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/route/waypoint.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/structure/exception.hxx>
 #include <simgear/constants.h>
@@ -279,6 +278,8 @@ FGAIWaypoint* const FGAIFlightPlan::getPreviousWaypoint( void ) const
 
 FGAIWaypoint* const FGAIFlightPlan::getCurrentWaypoint( void ) const
 {
+  if (wpt_iterator == waypoints.end())
+      return 0;
   return *wpt_iterator;
 }