From 74549784b48a3258a7d46148b4b2fcf04acfcd9c Mon Sep 17 00:00:00 2001 From: Durk Talsma Date: Sun, 4 Jul 2010 21:00:36 +0200 Subject: [PATCH] Whoops, forgot to add this file. --- src/AIModel/AIFlightPlan.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/AIModel/AIFlightPlan.cxx b/src/AIModel/AIFlightPlan.cxx index 381f9e944..1ad358e0e 100644 --- a/src/AIModel/AIFlightPlan.cxx +++ b/src/AIModel/AIFlightPlan.cxx @@ -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){