Merge branch 'no-op-zero-length-sounds' into 'master'

Do not play NULL sfx data

Closes #226

See merge request KartKrew/Kart!624
This commit is contained in:
Sal 2022-06-08 12:58:28 +00:00
commit d01453b136

View file

@ -678,6 +678,14 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
if (!sfx->data) if (!sfx->data)
{ {
sfx->data = I_GetSfx(sfx); 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 // increase the usefulness