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.
This commit is contained in:
toaster 2019-08-10 16:06:59 +01:00
parent 24526d4758
commit e3aec8e067
2 changed files with 11 additions and 12 deletions

View File

@ -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);
}
}

View File

@ -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)
{