From e47c97844d0b5a764f9f46a3fccac86aa9b2a87d Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 22 Jul 2003 08:13:10 +0000 Subject: [PATCH] Fix a devide by zero bug"src/Autopilot/newauto.cxx --- src/Autopilot/newauto.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Autopilot/newauto.cxx b/src/Autopilot/newauto.cxx index e0bed6acd..5c2109ecd 100644 --- a/src/Autopilot/newauto.cxx +++ b/src/Autopilot/newauto.cxx @@ -871,7 +871,7 @@ FGAutopilot::update (double dt) double lookahead; // estimate speed in 10 seconds - lookahead = airspeed_node->getFloatValue() + ( airspeed_node->getFloatValue() - previous_speed) * (10/dt); + lookahead = airspeed_node->getFloatValue() + ( airspeed_node->getFloatValue() - previous_speed) * (10/(dt + 0.000001)); previous_speed = airspeed_node->getFloatValue(); // compare targetspeed to anticipated airspeed