From f8015bf54f5439a9fa70661ac31a10ef8c81f58f Mon Sep 17 00:00:00 2001 From: "Curtis L. Olson" Date: Mon, 20 Dec 2010 12:20:57 -0600 Subject: [PATCH] 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. --- src/AIModel/AIShip.cxx | 4 ++++ 1 file changed, 4 insertions(+) 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;