1
0
Fork 0

Make sure _avionics is enabled before calling suspend, this fixes a crash caused by the way AI models are handled now.

This commit is contained in:
Erik Hofman 2012-03-31 11:45:28 +02:00
parent 954a09dce1
commit 47a910bccc

View file

@ -144,16 +144,16 @@ void
FGFX::update (double dt) FGFX::update (double dt)
{ {
if ( _enabled->getBoolValue() ) { if ( _enabled->getBoolValue() ) {
if ( _avionics_enabled->getBoolValue() && if ( _avionics_enabled->getBoolValue())
(_avionics_ext->getBoolValue() ||
_internal->getBoolValue()))
{ {
// avionics sound is enabled if (_avionics_ext->getBoolValue() || _internal->getBoolValue()) {
_avionics->resume(); // no-op if already in resumed state // avionics sound is enabled
_avionics->set_volume( _avionics_volume->getFloatValue() ); _avionics->resume(); // no-op if already in resumed state
_avionics->set_volume( _avionics_volume->getFloatValue() );
}
else
_avionics->suspend();
} }
else
_avionics->suspend();
set_volume( _volume->getDoubleValue() ); set_volume( _volume->getDoubleValue() );
resume(); resume();