From 9e5c9cfbd9a8cdd85839ebd8f09437e6d5006e0d Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 19 Aug 2023 04:27:51 -0700 Subject: [PATCH] Instawhip: don't hop if activated in the air --- src/k_kart.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 6b06c1d8a..a9d9deb70 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7816,7 +7816,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) } } - if (!P_MobjWasRemoved(player->whip)) + if (!P_MobjWasRemoved(player->whip) && (player->whip->flags2 & MF2_AMBUSH)) { // Linear acceleration and deceleration to a peak. // There is a constant total time to complete but the @@ -10963,6 +10963,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground) whip->fuse = INSTAWHIP_DURATION; player->flashing = max(player->flashing, INSTAWHIP_DURATION); + if (P_IsObjectOnGround(player->mo)) + { + whip->flags2 |= MF2_AMBUSH; + } + if (!K_PowerUpRemaining(player, POWERUP_BADGE)) { // Spawn in triangle formation