Do not play invalid sfx

This commit is contained in:
James R 2022-06-07 20:54:10 -07:00
parent 5f86c93021
commit 7e9dcffdf7

View file

@ -678,6 +678,14 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
if (!sfx->data)
{
sfx->data = I_GetSfx(sfx);
if (!sfx->data)
{
CONS_Alert(CONS_WARNING,
"Tried to load invalid sfx_%s\n",
sfx->name);
return;/* don't play it */
}
}
// increase the usefulness