From e1efbecc82aa43ef796cce3682f9ce02aeb16c76 Mon Sep 17 00:00:00 2001 From: BjossiAlfreds Date: Wed, 12 Oct 2022 13:42:48 +0000 Subject: [PATCH] Fixed ignoretrack0 and ogg menu option bugs --- src/client/menu/menu.c | 24 +++++------------------- src/client/sound/ogg.c | 1 + 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/client/menu/menu.c b/src/client/menu/menu.c index 0ecf4f82..c3adb572 100644 --- a/src/client/menu/menu.c +++ b/src/client/menu/menu.c @@ -2113,23 +2113,6 @@ static void OGGShuffleFunc(void *unused) { Cvar_SetValue("ogg_shuffle", s_options_oggshuffle_box.curvalue); - - cvar_t *ogg_enable= Cvar_Get("ogg_enable", "1", CVAR_ARCHIVE); - int track = (int)strtol(cl.configstrings[CS_CDTRACK], (char **)NULL, 10); - - if (s_options_oggshuffle_box.curvalue) - { - Cvar_Set("ogg_shuffle", "1"); - } - else - { - Cvar_Set("ogg_shuffle", "0"); - } - - if (ogg_enable->value) - { - OGG_PlayTrack(track); - } } static void @@ -2143,8 +2126,11 @@ EnableOGGMusic(void *unused) OGG_InitTrackList(); OGG_Stop(); - int track = (int)strtol(cl.configstrings[CS_CDTRACK], (char **)NULL, 10); - OGG_PlayTrack(track); + if (cls.state == ca_active) + { + int track = (int)strtol(cl.configstrings[CS_CDTRACK], (char **)NULL, 10); + OGG_PlayTrack(track); + } } else { diff --git a/src/client/sound/ogg.c b/src/client/sound/ogg.c index 25b61a86..37e90ffa 100644 --- a/src/client/sound/ogg.c +++ b/src/client/sound/ogg.c @@ -349,6 +349,7 @@ OGG_PlayTrack(int trackNo) if(ogg_ignoretrack0->value == 0) { OGG_Stop(); + return; } // Special case: If ogg_ignoretrack0 is 0 we stopped the music (see above)