From 842e4e50c2e742681f7cdb20f9fd265b3009c581 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Sat, 14 Feb 2026 21:02:32 -0500 Subject: [PATCH] Hacky garbage to fix map sfx playback until evalmath fix --- src/p_spec.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index 15b561338..e5e3ad0e4 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -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)