]> git.mxchange.org Git - flightgear.git/commitdiff
Avoid division by zero.
authorfrohlich <frohlich>
Sat, 23 May 2009 12:02:23 +0000 (12:02 +0000)
committerTim Moore <timoore@redhat.com>
Tue, 2 Jun 2009 22:18:55 +0000 (00:18 +0200)
Modified Files:
src/Instrumentation/inst_vertical_speed_indicator.cxx

src/Instrumentation/inst_vertical_speed_indicator.cxx

index fd339b481bbcebff465c3875d888757cd562506f..0237a6ded883c7a98a68a1e5fba518c0aee8a2fe 100644 (file)
@@ -20,6 +20,7 @@
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 
+#include <limits>
 #include <simgear/math/interpolater.hxx>
 
 #include "inst_vertical_speed_indicator.hxx"
@@ -191,7 +192,7 @@ void InstVerticalSpeedIndicator::update (double dt)
     if (_serviceable_node->getBoolValue())
     {
        // avoids hang, when freeze
-        if( !_freeze_node->getBoolValue() )
+        if( !_freeze_node->getBoolValue() && std::numeric_limits<double>::min() < fabs(dt))
        {
            double pressure_inhg = _pressure_node->getDoubleValue();
            double sea_inhg = _sea_node->getDoubleValue();