summaryrefslogtreecommitdiff
path: root/src/client/snd_openal.c
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-10-09 09:50:28 -0500
committerTim Angus <tim@ngus.net>2014-06-17 17:43:34 +0100
commit5c678ec30b0b83c4ed216d06b7b38c77f96e4b77 (patch)
treed9ad36dd3655746dae3cf6e2ff7e7fc335e426fc /src/client/snd_openal.c
parent765d551554d18ca685aeaf5a0f99bcb1f1a444de (diff)
Drop sounds starting with * before allocating sfx slot
Causes handle 0 to be returned by S_RegisterSound.
Diffstat (limited to 'src/client/snd_openal.c')
-rw-r--r--src/client/snd_openal.c9
1 files changed, 5 insertions, 4 deletions
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;