Drop sounds starting with * before allocating sfx slot

Causes handle 0 to be returned by S_RegisterSound.
This commit is contained in:
Zack Middleton committed 2013-10-09 09:51:32 -05:00
1 parent e4227d1cd5
commit a836c2db89
3 files changed
+10 -9

No files matched your search

+5 -4
View File
@@ -208,6 +208,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))
@@ -325,10 +330,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;