Don't play drive-on sound from materials when the game state is paused.
This commit is contained in:
Alayan 2024-05-08 17:40:48 +02:00
parent 99868d5897
commit e9a75f6c52
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View File

@ -519,7 +519,7 @@ void SFXManager::toggleSound(const bool on)
resume_later = (World::getWorld()->getPhase() == World::IN_GAME_MENU_PHASE);
for (int n=0; n<sfx_amount; n++)
{
// This also pauses sound effects
// This also pauses sound effects if they should be resumed later
m_all_sfx.getData()[n]->onSoundEnabledBack(resume_later);
}
m_all_sfx.unlock();

View File

@ -2003,7 +2003,8 @@ void Kart::handleMaterialSFX()
bool m_schedule_pause = m_flying ||
dynamic_cast<RescueAnimation*>(getKartAnimation()) ||
dynamic_cast<ExplosionAnimation*>(getKartAnimation());
dynamic_cast<ExplosionAnimation*>(getKartAnimation()) ||
World::getWorld()->getPhase() == World::IN_GAME_MENU_PHASE;
// terrain sound is not necessarily a looping sound so check its status before
// setting its speed, to avoid 'ressuscitating' sounds that had already stopped