From 6f22c5261e5e96c1ef03f76490a4033f5331ead8 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 7 Nov 2023 22:50:51 +0000 Subject: [PATCH] MT_POGOSPRING: Guarantee spawn of catholocism --- src/k_kart.c | 19 ++++++++++++++----- src/p_map.c | 8 ++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f875b96e0..628924e75 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6336,6 +6336,7 @@ static void K_DoShrink(player_t *user) void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) { fixed_t thrust = 0; + boolean dontapplymomz = false; if (mo->player && mo->player->spectator) return; @@ -6348,11 +6349,16 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) mo->eflags |= MFE_SPRUNG; - if (vertispeed <= 0) + if (vertispeed == 0) { vertispeed = P_AproxDistance(mo->momx, mo->momy); vertispeed = FixedMul(vertispeed, FINESINE(ANGLE_22h >> ANGLETOFINESHIFT)); } + else if (vertispeed < 0) + { + dontapplymomz = 0; + vertispeed = -vertispeed; + } thrust = vertispeed * P_MobjFlip(mo); @@ -6422,11 +6428,14 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) mo->player->fastfall = 0; } - mo->momz = FixedMul(thrust, mapobjectscale); - - if (mo->eflags & MFE_UNDERWATER) + if (dontapplymomz == false) { - mo->momz = FixedDiv(mo->momz, FixedSqrt(3*FRACUNIT)); + mo->momz = FixedMul(thrust, mapobjectscale); + + if (mo->eflags & MFE_UNDERWATER) + { + mo->momz = FixedDiv(mo->momz, FixedSqrt(3*FRACUNIT)); + } } P_ResetPitchRoll(mo); diff --git a/src/p_map.c b/src/p_map.c index c096dab60..b2693a122 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -427,12 +427,8 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) { if (spring->reactiontime == 0) { - object->player->tricktime = 0; // Reset post-hitlag timer - // Setup the boost for potential upwards trick, at worse, make it your regular max speed. (boost = curr speed*1.25) - object->player->trickboostpower = max(FixedDiv(object->player->speed, K_GetKartSpeed(object->player, false, false)) - FRACUNIT, 0)*125/100; - //CONS_Printf("Got boost: %d%\n", mo->player->trickboostpower*100 / FRACUNIT); - object->player->trickpanel = 1; - object->player->pflags |= PF_TRICKDELAY; + object->eflags &= ~MFE_SPRUNG; // needed to permit the following + K_DoPogoSpring(object, -vertispeed, 0); // negative so momz isn't modified } else {