Do not play invalid sfx

This commit is contained in:
James R authored and Alug committed 2026-06-05 23:07:26 +02:00
1 parent 667c67a61a
commit 4686e8e112
1 file changed
+8
+8
View File
@@ -586,6 +586,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