]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a bug where the search() function was not being called if power was false
authorcurt <curt>
Thu, 30 Oct 2008 20:42:21 +0000 (20:42 +0000)
committercurt <curt>
Thu, 30 Oct 2008 20:42:21 +0000 (20:42 +0000)
or the unit was not serviceable.  This search() routine needs to run every
iteration no matter what the power or serviceable state.  If power is turned
off or the unit becomes unserviceable while a beacon sound is playing, the
search() routine still needs to be called so the sound effect can be properly
disabled.

src/Instrumentation/marker_beacon.cxx

index 9d8022efe070b83c28d68e281342d1cdece52a93..822ef4e3d8588778c80542d4f20b95aca8e4713e 100644 (file)
@@ -156,14 +156,20 @@ FGMarkerBeacon::update(double dt)
 {
     need_update = false;
 
+    // On timeout, scan again, this needs to run every iteration no
+    // matter what the power or serviceable state.  If power is turned
+    // off or the unit becomes unserviceable while a beacon sound is
+    // playing, the search() routine still needs to be called so the
+    // sound effect can be properly disabled.
+
+    _time_before_search_sec -= dt;
+    if ( _time_before_search_sec < 0 ) {
+       search();
+    }
+
     if ( has_power() && serviceable->getBoolValue()
             && !sound_pause->getBoolValue()) {
 
-        // On timeout, scan again
-        _time_before_search_sec -= dt;
-        if ( _time_before_search_sec < 0 ) {
-            search();
-        }
         // marker beacon blinking
         bool light_on = ( outer_blink || middle_blink || inner_blink );
         SGTimeStamp current;