From e57b9f3f77b2505ca6a80c83e7d7bfe9f23e061a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 2 Jan 2018 13:06:49 -0500 Subject: [PATCH] Minimum wall bump speed copied from K_KartBouncing --- src/p_map.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index 2d503a4f..c6eddadb 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3948,6 +3948,28 @@ bounceback: tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); } + if (mo->player) + { + mobj_t *fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP); + if (mo->eflags & MFE_VERTICALFLIP) + fx->eflags |= MFE_VERTICALFLIP; + else + fx->eflags &= ~MFE_VERTICALFLIP; + fx->scale = mo->scale; + + if (cv_collidesounds.value == 1) + S_StartSound(mo, cv_collidesoundnum.value); + + if (P_AproxDistance(tmxmove, tmymove) < 25*FRACUNIT) + { + fixed_t momdiflength = P_AproxDistance(tmxmove, tmymove); + fixed_t normalisedx = FixedDiv(tmxmove, momdiflength); + fixed_t normalisedy = FixedDiv(tmymove, momdiflength); + tmxmove = FixedMul(25*FRACUNIT, normalisedx); + tmymove = FixedMul(25*FRACUNIT, normalisedy); + } + } + P_HitBounceLine(bestslideline); // clip the moves mo->momx = tmxmove;