From 72bdda2c48147f37c7f3630f0b5353ef319b6a85 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 13 Feb 2008 19:06:11 +0000 Subject: Don't try to precache sound effects that don't exist. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1085 --- src/i_sdlsound.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/i_sdlsound.c') 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) -- cgit v1.2.3