]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a devide by zero bug"src/Autopilot/newauto.cxx
authorehofman <ehofman>
Tue, 22 Jul 2003 08:13:10 +0000 (08:13 +0000)
committerehofman <ehofman>
Tue, 22 Jul 2003 08:13:10 +0000 (08:13 +0000)
src/Autopilot/newauto.cxx

index e0bed6acdcd6b2ad15f0cb92a9c523e7d46aa7cc..5c2109ecd430dd8549ac677b62de261d97c36f86 100644 (file)
@@ -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