Merge pull request #309 from rg3/ogg_enable_fix

Fix segfault in OGG_PlayTrack when ogg_enable is set to zero
This commit is contained in:
Yamagi 2018-07-16 16:03:35 +02:00 committed by GitHub
commit d429c91270
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -555,6 +555,11 @@ OGG_Cmd(void)
void void
OGG_Init(void) OGG_Init(void)
{ {
// Cvars
cd_shuffle = Cvar_Get("cd_shuffle", "0", CVAR_ARCHIVE);
ogg_ignoretrack0 = Cvar_Get("ogg_ignoretrack0", "0", CVAR_ARCHIVE);
ogg_volume = Cvar_Get("ogg_volume", "0.7", CVAR_ARCHIVE);
cvar_t *ogg_enabled = Cvar_Get("ogg_enable", "1", CVAR_ARCHIVE); cvar_t *ogg_enabled = Cvar_Get("ogg_enable", "1", CVAR_ARCHIVE);
if (ogg_enabled->value != 1) if (ogg_enabled->value != 1)
@ -562,11 +567,6 @@ OGG_Init(void)
return; return;
} }
// Cvars
cd_shuffle = Cvar_Get("cd_shuffle", "0", CVAR_ARCHIVE);
ogg_ignoretrack0 = Cvar_Get("ogg_ignoretrack0", "0", CVAR_ARCHIVE);
ogg_volume = Cvar_Get("ogg_volume", "0.7", CVAR_ARCHIVE);
// Commands // Commands
Cmd_AddCommand("ogg", OGG_Cmd); Cmd_AddCommand("ogg", OGG_Cmd);