P_GetMobjVoice: Mute objects shouldn't break reality

(removes the crash when an object has no voice)
This commit is contained in:
yamamama 2025-12-02 11:05:10 -05:00
parent a8b201cf2d
commit a8a5d703eb

View file

@ -14987,20 +14987,17 @@ kartvoice_t *P_GetMobjVoice(const mobj_t *mo)
{
return mo->voice;
}
#ifdef PARANOIA
else
{
I_Error("P_GetMobjVoice: This object has no voice!");
return NULL;
}
#else
else if (mo->skin)
{
return &((skin_t *)mo->skin)->voices[0];
}
// Scream at the idiot that let this happen :^)
CONS_Printf(
"PARANOIA/P_GetMobjVoice: %p MT_%s passed to function with NULL voice\n",
(void*)mo,
MobjTypeName(mo)
);
#endif
return NULL;
#endif
}
//