Hacky garbage to fix map sfx playback until evalmath fix

This commit is contained in:
NepDisk 2026-02-14 21:02:32 -05:00
parent 2b503fbb5a
commit 842e4e50c2

View file

@ -2993,8 +2993,28 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
break;
case 414: // Play SFX
P_PlaySFX(stringargs[0] ? get_number(stringargs[0]) : sfx_None, mo, callsec, args[2], args[0], args[1]);
{
// I'm so sorry with this garbage
// I cannot be bothered to fix evalmath right now...
char *upstr = NULL;
if (stringargs[0])
{
size_t strsize = strlen(stringargs[0]);
upstr = malloc(strsize);
if (!upstr)
I_Error("Play SFX: Ran out of memory\n");
strncpy(upstr, stringargs[0], strsize);
strupr(upstr);
}
P_PlaySFX(upstr ? get_sfx(upstr) : sfx_None, mo, callsec, args[2], args[0], args[1]);
if (upstr)
free(upstr);
break;
}
case 415: // Run a script
if (cv_runscripts.value)