Merge pull request #921 from BjossiAlfreds/ogg

Fixed ignoretrack0 and ogg menu option bugs
This commit is contained in:
Yamagi 2022-10-16 18:57:35 +02:00 committed by GitHub
commit caab3864c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 19 deletions

View file

@ -2113,23 +2113,6 @@ static void
OGGShuffleFunc(void *unused) OGGShuffleFunc(void *unused)
{ {
Cvar_SetValue("ogg_shuffle", s_options_oggshuffle_box.curvalue); 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 static void
@ -2143,9 +2126,12 @@ EnableOGGMusic(void *unused)
OGG_InitTrackList(); OGG_InitTrackList();
OGG_Stop(); OGG_Stop();
if (cls.state == ca_active)
{
int track = (int)strtol(cl.configstrings[CS_CDTRACK], (char **)NULL, 10); int track = (int)strtol(cl.configstrings[CS_CDTRACK], (char **)NULL, 10);
OGG_PlayTrack(track); OGG_PlayTrack(track);
} }
}
else else
{ {
OGG_Shutdown(); OGG_Shutdown();

View file

@ -349,6 +349,7 @@ OGG_PlayTrack(int trackNo)
if(ogg_ignoretrack0->value == 0) if(ogg_ignoretrack0->value == 0)
{ {
OGG_Stop(); OGG_Stop();
return;
} }
// Special case: If ogg_ignoretrack0 is 0 we stopped the music (see above) // Special case: If ogg_ignoretrack0 is 0 we stopped the music (see above)