Fix #1631 (SFX can not be enabled in in-race game menu).

This commit is contained in:
hiker
2014-10-22 17:16:39 +11:00
parent 9e76a81bfd
commit 86b8036926

View File

@@ -239,6 +239,9 @@ void SFXOpenAL::reallySetMasterVolumeNow(float gain)
*/
void SFXOpenAL::setLoop(bool status)
{
// Set the flag (even if sfx are disabled), so that the right settings
// are available on restart.
m_loop = status;
if (m_status == SFX_UNKNOWN || !SFXManager::get()->sfxAllowed()) return;
SFXManager::get()->queue(SFXManager::SFX_LOOP, this, status ? 1.0f : 0.0f);
} // setLoop
@@ -254,7 +257,6 @@ void SFXOpenAL::reallySetLoop(bool status)
if(m_status==SFX_UNKNOWN)
return;
}
m_loop = status;
alSourcei(m_sound_source, AL_LOOPING, status ? AL_TRUE : AL_FALSE);
SFXManager::checkError("looping");