From afff038e34173dae5aba8a99730540a7ec13f534 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 25 Mar 2023 22:43:54 +0000 Subject: [PATCH] s_sound.c: Only call P_RestoreMusic in GS_LEVEL This function isn't supposed to be called outside of it --- src/s_sound.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 79dba06dc..91718ad91 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2623,10 +2623,18 @@ static void Command_RestartAudio_f(void) S_StartSound(NULL, sfx_strpst); - if (Playing()) // Gotta make sure the player is in a level + if (gamestate == GS_LEVEL) // Gotta make sure the player is in a level + { P_RestoreMusic(&players[consoleplayer]); + } + else if (gamestate == GS_TITLESCREEN) + { + S_ChangeMusicInternal("_title", looptitle); + } else - S_ChangeMusicInternal("titles", looptitle); + { + M_PlayMenuJam(); + } } static void Command_PlaySound(void) @@ -2726,7 +2734,7 @@ void GameDigiMusic_OnChange(void) I_StartupSound(); // will return early if initialised I_InitMusic(); - if (Playing()) + if (gamestate == GS_LEVEL) { P_RestoreMusic(&players[consoleplayer]); }