]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIFlightPlan.cxx
Merge branch 'maint2' into next
[flightgear.git] / src / AIModel / AIFlightPlan.cxx
index abb49de4389db587d117ed083e7d88afc573999b..438d9912552993126bd992e9bc62ebdfdabd8125 100644 (file)
@@ -20,6 +20,8 @@
 #  include <config.h>
 #endif
 
+#include <iostream>
+
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/route/waypoint.hxx>
 #include <simgear/structure/exception.hxx>
 #include <simgear/constants.h>
 #include <simgear/props/props.hxx>
+#include <simgear/props/props_io.hxx>
+
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/fg_init.hxx>
 #include <Airports/simple.hxx>
 #include <Airports/runways.hxx>
-
+#include <Airports/groundnetwork.hxx>
 
 #include <Environment/environment_mgr.hxx>
 #include <Environment/environment.hxx>
 
 #include "AIFlightPlan.hxx"
 
+using std::cerr;
+
 
 FGAIFlightPlan::FGAIFlightPlan(const string& filename)
 {
@@ -375,6 +381,10 @@ void FGAIFlightPlan::setLeadDistance(double speed, double bearing,
   // At a turn rate of 30 degrees per second, it takes 12 seconds to do a full 360 degree turn
   // So, to get an estimate of the turn radius, calculate the cicumference of the circle
   // we travel on. Get the turn radius by dividing by PI (*2).
+  if (speed < 0.5) {
+        lead_distance = 0.5;
+        return;
+  }
   if (speed < 25) {
        turn_radius = ((360/30)*15) / (2*M_PI);
   } else