]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
snd_initialized is now checked by S_FindName and S_PrecacheSound (Thanks to Moz for...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 8 Oct 2003 02:37:00 +0000 (02:37 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 8 Oct 2003 02:37:00 +0000 (02:37 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3551 d7cf8633-e32d-0410-b094-e92efae38249

snd_dma.c

index 071710e204fe16f43807817eb2e3c5cc27ac5ec3..8e749b695615dd649fe54d7293963f16cab97159 100644 (file)
--- 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;