From ccb9e64caf89d6910366e4e997452a13bbc3e133 Mon Sep 17 00:00:00 2001 From: frohlich Date: Fri, 4 Sep 2009 17:01:53 +0000 Subject: [PATCH] Avoid division by zero. Modified Files: src/Instrumentation/dme.cxx --- src/Instrumentation/dme.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Instrumentation/dme.cxx b/src/Instrumentation/dme.cxx index 5685dbabe..754008bd4 100644 --- a/src/Instrumentation/dme.cxx +++ b/src/Instrumentation/dme.cxx @@ -146,7 +146,8 @@ DME::update (double delta_time_sec) } _distance_node->setDoubleValue( tmp_dist ); _speed_node->setDoubleValue(speed_kt); - _time_node->setDoubleValue(distance_nm/speed_kt*60.0); + if (SGLimitsd::min() < fabs(speed_kt)) + _time_node->setDoubleValue(distance_nm/speed_kt*60.0); } else { _last_distance_nm = 0;