shithub: choc

Download patch

ref: 72bdda2c48147f37c7f3630f0b5353ef319b6a85
parent: 52228a0b81e919879afdd23ae82794cdfe621f84
author: Simon Howard <[email protected]>
date: Wed Feb 13 14:06:11 EST 2008

Don't try to precache sound effects that don't exist.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1085

--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -479,6 +479,7 @@
 
 static void I_PrecacheSounds(void)
 {
+    char namebuf[9];
     int i;
 
     printf("I_PrecacheSounds: Precaching all sound effects..");
@@ -491,9 +492,12 @@
             fflush(stdout);
         }
 
-        if (S_sfx[i].link == NULL)
-        {            
-            S_sfx[i].lumpnum = I_SDL_GetSfxLumpNum(&S_sfx[i]);
+        sprintf(namebuf, "ds%s", DEH_String(S_sfx[i].name));
+
+        S_sfx[i].lumpnum = W_CheckNumForName(namebuf);
+
+        if (S_sfx[i].lumpnum != -1)
+        {
             CacheSFX(i);
 
             if (sound_chunks[i].abuf != NULL)