From: havoc Date: Wed, 8 Oct 2003 02:37:00 +0000 (+0000) Subject: snd_initialized is now checked by S_FindName and S_PrecacheSound (Thanks to Moz for... X-Git-Tag: xonotic-v0.1.0preview~6335 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=309feb665ffe9f619730b532e9fa4ec5b4e0ae39;p=xonotic%2Fdarkplaces.git snd_initialized is now checked by S_FindName and S_PrecacheSound (Thanks to Moz for reporting the -nosound crash) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3551 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_dma.c b/snd_dma.c index 071710e2..8e749b69 100644 --- a/snd_dma.c +++ b/snd_dma.c @@ -274,6 +274,9 @@ sfx_t *S_FindName (char *name) int i; sfx_t *sfx; + if (!snd_initialized) + return NULL; + if (!name) Host_Error("S_FindName: NULL\n"); @@ -316,9 +319,12 @@ sfx_t *S_PrecacheSound (char *name, int complain) { sfx_t *sfx; + if (!snd_initialized) + return NULL; + sfx = S_FindName(name); - if (snd_initialized && !nosound.integer && snd_precache.integer) + if (!nosound.integer && snd_precache.integer) S_LoadSound(sfx, complain); return sfx;