From 8052e66d5836ee1d6cc8096f15e08cad0ecbeb9c Mon Sep 17 00:00:00 2001 From: Julia Nechaevskaya Date: Wed, 5 Apr 2023 23:18:42 +0300 Subject: [PATCH] Proper sound clipping for map 08 --- src/doom/s_sound.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/doom/s_sound.c b/src/doom/s_sound.c index 5d80d76b..c91673b9 100644 --- a/src/doom/s_sound.c +++ b/src/doom/s_sound.c @@ -414,6 +414,9 @@ static int S_AdjustSoundParams(mobj_t *listener, mobj_t *source, fixed_t ady; angle_t angle; + // [crispy] proper sound clipping in Doom 2 MAP08 and The Ultimate Doom E4M8 + const boolean doom1map8 = (gamemap == 8 && ((gamemode != commercial && gameepisode < 4))); + // calculate the distance to sound origin // and clip it if necessary adx = abs(listener->x - source->x); @@ -422,7 +425,7 @@ static int S_AdjustSoundParams(mobj_t *listener, mobj_t *source, // From _GG1_ p.428. Appox. eucledian distance fast. approx_dist = adx + ady - ((adx < ady ? adx : ady)>>1); - if (gamemap != 8 && approx_dist > S_CLIPPING_DIST) + if (!doom1map8 && approx_dist > S_CLIPPING_DIST) { return 0; }