1
0
Fork 0

Fix a bug where the search() function was not being called if power was false

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.
This commit is contained in:
curt 2008-10-30 20:42:21 +00:00
parent e8ff28f9f8
commit 692afe0bcb

View file

@ -156,14 +156,20 @@ FGMarkerBeacon::update(double dt)
{
need_update = false;
if ( has_power() && serviceable->getBoolValue()
&& !sound_pause->getBoolValue()) {
// 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.
// On timeout, scan again
_time_before_search_sec -= dt;
if ( _time_before_search_sec < 0 ) {
search();
}
if ( has_power() && serviceable->getBoolValue()
&& !sound_pause->getBoolValue()) {
// marker beacon blinking
bool light_on = ( outer_blink || middle_blink || inner_blink );
SGTimeStamp current;