]> git.mxchange.org Git - flightgear.git/commitdiff
Whoops, forgot to add this file.
authorDurk Talsma <durk@linux-iue5.site>
Sun, 4 Jul 2010 19:00:36 +0000 (21:00 +0200)
committerDurk Talsma <durk@linux-iue5.site>
Sun, 4 Jul 2010 19:00:36 +0000 (21:00 +0200)
src/AIModel/AIFlightPlan.cxx

index 381f9e94498f0680d44eaab337aa4a08005edf04..1ad358e0eb6ecd2b58be01e21491620ae778102e 100644 (file)
@@ -419,9 +419,11 @@ void FGAIFlightPlan::setLeadDistance(double speed, double bearing,
   
   //lead_distance = turn_radius * sin(leadInAngle * SG_DEGREES_TO_RADIANS); 
   lead_distance = turn_radius * tan((leadInAngle * SG_DEGREES_TO_RADIANS)/2);
-  //  if ((errno == EDOM) || (errno == ERANGE) || lead_distance < 1.0)
-  //  {
-  //  }
+  if (lead_distance > (3*turn_radius)) {
+      // cerr << "Warning: Lead-in distance is large. Inbound = " << inbound
+      //      << ". Outbound = " << outbound << ". Lead in angle = " << leadInAngle  << ". Turn radius = " << turn_radius << endl;
+       lead_distance = 3 * turn_radius;
+  }
 }
 
 void FGAIFlightPlan::setLeadDistance(double distance_ft){