From 652792ddd32a9586a79e9fe3805b5d8df4f0f733 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 27 Aug 2023 04:36:07 -0700 Subject: [PATCH] K_KartSpindash: reorganize so fastfallBase doesn't need to be reset on landing Makes resetting fastfall due to special conditions more straightforward, because you don't need to reset fastfallBase also. --- src/k_kart.c | 10 +++++----- src/p_inter.c | 1 - src/p_user.c | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index c31ef9cdc..b3370c20a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10437,16 +10437,17 @@ static void K_KartSpindash(player_t *player) { if (player->pflags & PF_NOFASTFALL) return; - // Update fastfall. - player->fastfall = player->mo->momz; - player->spindash = 0; - if (player->fastfallBase == 0) + if (player->fastfall == 0) { // Factors 3D momentum. player->fastfallBase = FixedHypot(player->speed, player->mo->momz); } + // Update fastfall. + player->fastfall = player->mo->momz; + player->spindash = 0; + return; } else if (player->fastfall != 0) @@ -10574,7 +10575,6 @@ boolean K_FastFallBounce(player_t *player) player->mo->momz = bounce * P_MobjFlip(player->mo); player->fastfall = 0; - player->fastfallBase = 0; return true; } diff --git a/src/p_inter.c b/src/p_inter.c index 890644320..d73e3622e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2578,7 +2578,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da player->driftboost = player->strongdriftboost = 0; player->gateBoost = 0; player->fastfall = 0; - player->fastfallBase = 0; player->ringboost = 0; player->glanceDir = 0; player->pflags &= ~PF_GAINAX; diff --git a/src/p_user.c b/src/p_user.c index a5176e580..cde8642d8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -484,7 +484,6 @@ void P_ResetPlayer(player_t *player) player->trickpanel = 0; player->glanceDir = 0; player->fastfall = 0; - player->fastfallBase = 0; if (player->mo != NULL && P_MobjWasRemoved(player->mo) == false) {