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:
parent
e8ff28f9f8
commit
692afe0bcb
1 changed files with 11 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue