From 842b503d9094400af2e86f66ae402e6edbd5c5ce Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 6 Aug 2019 23:18:53 +0200 Subject: [PATCH 1/2] Don't zero out momz when landing on slopes. This fixes Fang's bounce on slopes and doesn't seem to make a difference otherwise, but there's still a non-zero chance this broke something. --- src/p_slopes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index d6080c15d..f89dd3c96 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -717,7 +717,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) if (slope->flags & SL_NOPHYSICS) { // No physics, no need to make anything complicated. if (P_MobjFlip(thing)*(thing->momz) < 0) { // falling, land on slope - thing->momz = -P_MobjFlip(thing); + //thing->momz = -P_MobjFlip(thing); thing->standingslope = slope; } return; @@ -732,7 +732,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) if (P_MobjFlip(thing)*mom.z < 0) { // falling, land on slope thing->momx = mom.x; thing->momy = mom.y; - thing->momz = -P_MobjFlip(thing); + //thing->momz = -P_MobjFlip(thing); thing->standingslope = slope; } From aac9592e3108258c1ae8d24158986d0e5e3edbb5 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 6 Aug 2019 23:35:20 +0200 Subject: [PATCH 2/2] Set Fang's minimum bounce strength to 1.5 times jump strength --- src/p_user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 0a338a6e7..0861398d6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4730,6 +4730,7 @@ void P_DoAbilityBounce(player_t *player, boolean changemomz) return; if (changemomz) { + fixed_t minmomz; prevmomz = player->mo->momz; if (P_MobjFlip(player->mo)*prevmomz < 0) prevmomz = 0; @@ -4737,7 +4738,8 @@ void P_DoAbilityBounce(player_t *player, boolean changemomz) prevmomz /= 2; P_DoJump(player, false); player->pflags &= ~(PF_STARTJUMP|PF_JUMPED); - player->mo->momz = (FixedMul(player->mo->momz, 3*FRACUNIT/2) + prevmomz)/2; + minmomz = FixedMul(player->mo->momz, 3*FRACUNIT/2); + player->mo->momz = max(minmomz, (minmomz + prevmomz)/2); } S_StartSound(player->mo, sfx_boingf); P_SetPlayerMobjState(player->mo, S_PLAY_BOUNCE_LANDING);