From e3aec8e067ce71698c4ffd447e204f718d1c1780 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 10 Aug 2019 16:06:59 +0100 Subject: [PATCH] Fix all our landing woes. (For now.) * Player state upon collision with ground after rolling now sets state properly. * Fix the thing where Knuckles can glide up a slope like it's nothing WHILE keeping things working for bouncers. --- src/p_slopes.c | 10 ++++++---- src/p_user.c | 13 +++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index f89dd3c96..b06460084 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -716,9 +716,11 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) vector3_t mom; // Ditto. 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); + if (P_MobjFlip(thing)*(thing->momz) < 0) // falling, land on slope + { thing->standingslope = slope; + if (!thing->player || !(thing->player->pflags & PF_BOUNCING)) + thing->momz = -P_MobjFlip(thing); } return; } @@ -732,9 +734,9 @@ 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->standingslope = slope; + if (!thing->player || !(thing->player->pflags & PF_BOUNCING)) + thing->momz = -P_MobjFlip(thing); } } diff --git a/src/p_user.c b/src/p_user.c index 0861398d6..128d4e7d7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2194,13 +2194,10 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff) if ((clipmomz = !(P_CheckDeathPitCollide(player->mo))) && player->mo->health && !player->spectator) { - if (dorollstuff) - { - if ((player->charability2 == CA2_SPINDASH) && !(player->pflags & PF_THOKKED) && (player->cmd.buttons & BT_USE) && (FixedHypot(player->mo->momx, player->mo->momy) > (5*player->mo->scale))) - player->pflags |= PF_SPINNING; - else - player->pflags &= ~PF_SPINNING; - } + if (dorollstuff && (player->charability2 == CA2_SPINDASH) && !(player->pflags & PF_THOKKED) && (player->cmd.buttons & BT_USE) && (FixedHypot(player->mo->momx, player->mo->momy) > (5*player->mo->scale))) + player->pflags |= PF_SPINNING; + else if (!(player->pflags & PF_STARTDASH)) + player->pflags &= ~PF_SPINNING; if (player->pflags & PF_SPINNING) { @@ -2268,7 +2265,7 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff) } else if (player->charability2 == CA2_GUNSLINGER && player->panim == PA_ABILITY2) ; - else if (player->pflags & PF_JUMPED || player->powers[pw_tailsfly] || player->mo->state-states == S_PLAY_FLY_TIRED) + else if (player->panim != PA_IDLE && player->panim != PA_WALK && player->panim != PA_RUN && player->panim != PA_DASH) { if (player->cmomx || player->cmomy) {