don't try to load again sound lumps that unce failed to load

This commit is contained in:
Fabian Greffrath 2023-01-11 15:45:02 +01:00
parent 95cde386eb
commit 5eb640fd03
2 changed files with 4 additions and 3 deletions

View File

@ -170,7 +170,7 @@ static boolean CacheSound(sfxinfo_t *sfx, int channel, int pitch)
lumpnum = I_GetSfxLumpNum(sfx);
if (lumpnum == -1)
if (lumpnum < 0)
{
return false;
}
@ -269,6 +269,7 @@ static boolean CacheSound(sfxinfo_t *sfx, int channel, int pitch)
if (sfx->data == NULL)
{
sfx->lumpnum = -2; // [FG] don't try again
return false;
}

View File

@ -2097,8 +2097,8 @@ static void P_SecretRevealed(player_t *player)
if (sfx_id == -1)
{
sfx_id = I_GetSfxLumpNum(&S_sfx[sfx_secret]) != -1 ? sfx_secret :
I_GetSfxLumpNum(&S_sfx[sfx_itmbk]) != -1 ? sfx_itmbk :
sfx_id = I_GetSfxLumpNum(&S_sfx[sfx_secret]) >= 0 ? sfx_secret :
I_GetSfxLumpNum(&S_sfx[sfx_itmbk]) >= 0 ? sfx_itmbk :
-2;
}