From a9ad2a3a9efdfb26a6cbfd325a21c6e87eda7591 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 11 Nov 2022 18:40:36 +0100 Subject: [PATCH] - fixed: when deactivating the app, pausing the sound system should not depend on the game's internal pause state. All this tells is that the gameplay was halted. Sound was not stopped when the user either minimized or tabbed away in the in-game menu. This commit had to be reapplied because it got lost in a backend update. --- source/common/audio/sound/s_sound.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/source/common/audio/sound/s_sound.cpp b/source/common/audio/sound/s_sound.cpp index a9f12d8d2..7cd1a8889 100644 --- a/source/common/audio/sound/s_sound.cpp +++ b/source/common/audio/sound/s_sound.cpp @@ -1824,26 +1824,20 @@ void S_SetSoundPaused(int state) if ((state || i_soundinbackground) && !pauseext) { - if (paused == 0) + S_ResumeSound(true); + if (GSnd != nullptr) { - S_ResumeSound(true); - if (GSnd != nullptr) - { - GSnd->SetInactive(SoundRenderer::INACTIVE_Active); - } + GSnd->SetInactive(SoundRenderer::INACTIVE_Active); } } else { - if (paused == 0) + S_PauseSound(false, true); + if (GSnd != nullptr) { - S_PauseSound(false, true); - if (GSnd != nullptr) - { - GSnd->SetInactive(gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL ? - SoundRenderer::INACTIVE_Complete : - SoundRenderer::INACTIVE_Mute); - } + GSnd->SetInactive(gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL ? + SoundRenderer::INACTIVE_Complete : + SoundRenderer::INACTIVE_Mute); } } }