summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2008-02-13 19:06:11 +0000
committerSimon Howard2008-02-13 19:06:11 +0000
commit72bdda2c48147f37c7f3630f0b5353ef319b6a85 (patch)
tree1d7681cbab4a1d65610a41c1487f5d68c9218cf9
parent52228a0b81e919879afdd23ae82794cdfe621f84 (diff)
downloadchocolate-doom-72bdda2c48147f37c7f3630f0b5353ef319b6a85.tar.gz
chocolate-doom-72bdda2c48147f37c7f3630f0b5353ef319b6a85.tar.bz2
chocolate-doom-72bdda2c48147f37c7f3630f0b5353ef319b6a85.zip
Don't try to precache sound effects that don't exist.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1085
-rw-r--r--src/i_sdlsound.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index 54799ac3..f89c2aea 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -479,6 +479,7 @@ static void I_SDL_ShutdownSound(void)
static void I_PrecacheSounds(void)
{
+ char namebuf[9];
int i;
printf("I_PrecacheSounds: Precaching all sound effects..");
@@ -491,9 +492,12 @@ static void I_PrecacheSounds(void)
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)