Do not play invalid sfx

This commit is contained in:
James R authored and Alug committed 2026-06-05 23:00:19 +02:00
1 parent edb9c76a8b
commit 1b95b0ff15
1 file changed
+8
+8
View File
@@ -590,6 +590,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 */
}
}
// Avoid channel reverse if surround