From e3aec8e067ce71698c4ffd447e204f718d1c1780 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 10 Aug 2019 16:06:59 +0100 Subject: [PATCH 1/3] 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) { From ed8ad7abde7968688b027ad6da23b7ccd7de495e Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 11 Aug 2019 14:36:52 +0100 Subject: [PATCH 2/3] Did some testing, needed to fix one more issue with moving surfaces and spinning. --- src/p_map.c | 2 +- src/p_user.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 6beca92f1..8b00397ca 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2884,7 +2884,7 @@ static boolean P_ThingHeightClip(mobj_t *thing) if (thing->z != oldz) { if (thing->player) - P_PlayerHitFloor(thing->player, false); + P_PlayerHitFloor(thing->player, !onfloor); } // debug: be sure it falls to the floor diff --git a/src/p_user.c b/src/p_user.c index 128d4e7d7..c583e076b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2194,10 +2194,13 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff) if ((clipmomz = !(P_CheckDeathPitCollide(player->mo))) && player->mo->health && !player->spectator) { - 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 (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 if (!(player->pflags & PF_STARTDASH)) + player->pflags &= ~PF_SPINNING; + } if (player->pflags & PF_SPINNING) { From f85bc7c61fa4f3d28221b6e0f7d08a872448cb24 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 11 Aug 2019 19:37:15 +0100 Subject: [PATCH 3/3] Fix Rob's Knuckles issue. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index c583e076b..82bf9f99f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2217,7 +2217,7 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff) player->skidtime = TICRATE; player->mo->tics = -1; } - else + else if (!player->skidtime) player->pflags &= ~PF_GLIDING; } else if (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)