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)
{
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
{

View file

@ -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)