Prevent airwalking in general, but only when going down.

This commit is contained in:
sphere 2020-06-21 18:07:24 +02:00
parent 9cdad10ae6
commit 12b24517de

View file

@ -8149,6 +8149,7 @@ static void P_MovePlayer(player_t *player)
}
// Correct floating when ending up on the ground.
// Also fight against airwalking when going down.
if (onground)
{
if (player->mo->state-states == S_PLAY_FLOAT)
@ -8156,6 +8157,11 @@ static void P_MovePlayer(player_t *player)
else if (player->mo->state-states == S_PLAY_FLOAT_RUN)
P_SetPlayerMobjState(player->mo, S_PLAY_RUN);
}
else
{
if ((player->mo->state-states == S_PLAY_WALK || player->mo->state-states == S_PLAY_RUN) && P_MobjFlip(player->mo)*player->mo->momz < 0)
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
}
// If Springing (or nojumpspinning), but travelling DOWNWARD, change back!
if ((player->panim == PA_SPRING && P_MobjFlip(player->mo)*player->mo->momz < 0)