X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIFlightPlan.cxx;h=438d9912552993126bd992e9bc62ebdfdabd8125;hb=90b2d25671d60ff3c5561791676f27d31676904c;hp=f18f0a346c6162aa6867fa01fab0a621d0179b39;hpb=7783e6495336cb7ed83778381701c521c43a102f;p=flightgear.git diff --git a/src/AIModel/AIFlightPlan.cxx b/src/AIModel/AIFlightPlan.cxx index f18f0a346..438d99125 100644 --- a/src/AIModel/AIFlightPlan.cxx +++ b/src/AIModel/AIFlightPlan.cxx @@ -20,28 +20,31 @@ # include #endif +#include + #include #include #include #include #include #include -#ifdef __BORLANDC__ -# define exception c_exception -#endif #include +#include + #include
#include
#include
#include #include - +#include #include #include #include "AIFlightPlan.hxx" +using std::cerr; + FGAIFlightPlan::FGAIFlightPlan(const string& filename) { @@ -378,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