From 12b24517de0081a44f66ddcc0957f89e04e14e55 Mon Sep 17 00:00:00 2001 From: sphere Date: Sun, 21 Jun 2020 18:07:24 +0200 Subject: [PATCH] Prevent airwalking in general, but only when going down. --- src/p_user.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index d426277ff..5335f2c57 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -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)