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:
parent
954a09dce1
commit
47a910bccc
1 changed files with 8 additions and 8 deletions
|
@ -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();
|
||||||
|
|
Loading…
Add table
Reference in a new issue