]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/inst_vertical_speed_indicator.cxx
Support for multiple data dirs.
[flightgear.git] / src / Instrumentation / inst_vertical_speed_indicator.cxx
index fd339b481bbcebff465c3875d888757cd562506f..639b950255112aa64d07dea180874fee0599305e 100644 (file)
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <limits>
 #include <simgear/math/interpolater.hxx>
 
 #include "inst_vertical_speed_indicator.hxx"
@@ -180,9 +185,14 @@ void InstVerticalSpeedIndicator::init ()
         node->getNode("indicated-speed-fps", true);
     _speed_min_node =
         node->getNode("indicated-speed-fpm", true);
+}
 
+void InstVerticalSpeedIndicator::reinit ()
+{
     // Initialize at ambient pressure
     _internal_pressure_inhg = _pressure_node->getDoubleValue();
+    _speed_ft_per_s = 0.0;
+    _internal_sea_inhg = _sea_node->getDoubleValue();
 }
 
 
@@ -191,7 +201,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();