From: Curtis L. Olson Date: Mon, 20 Dec 2010 18:20:57 +0000 (-0600) Subject: Add a small bit of nan/fpe protection. It's possible that this routine X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f8015bf54f5439a9fa70661ac31a10ef8c81f58f;p=flightgear.git Add a small bit of nan/fpe protection. It's possible that this routine could be called with a zero dt which would then lead to a divide by zero error if we ran through all the computations. --- diff --git a/src/AIModel/AIShip.cxx b/src/AIModel/AIShip.cxx index 9eecd6c97..9b6a04705 100644 --- a/src/AIModel/AIShip.cxx +++ b/src/AIModel/AIShip.cxx @@ -620,6 +620,10 @@ double FGAIShip::getCourse(double lat, double lon, double lat2, double lon2) con void FGAIShip::ProcessFlightPlan(double dt) { + if ( dt < 0.00001 ) { + return; + } + double time_sec = getDaySeconds(); _dt_count += dt;