From 5c678ec30b0b83c4ed216d06b7b38c77f96e4b77 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 9 Oct 2013 09:50:28 -0500 Subject: Drop sounds starting with * before allocating sfx slot Causes handle 0 to be returned by S_RegisterSound. --- src/client/snd_openal.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/client/snd_openal.c') diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c index 23a6a67d..b7ce3f0f 100644 --- a/src/client/snd_openal.c +++ b/src/client/snd_openal.c @@ -211,6 +211,11 @@ static sfxHandle_t S_AL_BufferFind(const char *filename) return 0; } + if ( filename[0] == '*' ) { + Com_Printf( S_COLOR_YELLOW "WARNING: Tried to load player sound directly: %s\n", filename ); + return 0; + } + for(i = 0; i < numSfx; i++) { if(!Q_stricmp(knownSfx[i].filename, filename)) @@ -328,10 +333,6 @@ static void S_AL_BufferLoad(sfxHandle_t sfx, qboolean cache) if(curSfx->filename[0] == '\0') return; - // Player SFX - if(curSfx->filename[0] == '*') - return; - // Already done? if((curSfx->inMemory) || (curSfx->isDefault) || (!cache && curSfx->isDefaultChecked)) return; -- cgit