From 8ff95af61dfe672a280b269b66ca39c74a0df0d7 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 14 Jan 2023 18:35:49 -0800 Subject: [PATCH] Disable Drop Dashing while on the Garden Top --- src/k_respawn.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/k_respawn.c b/src/k_respawn.c index 7d1207b10..873d00fd7 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -661,6 +661,42 @@ static void K_DropDashWait(player_t *player) } +/*-------------------------------------------------- + static boolean K_CanDropDash(player_t *player) + + Checks if you can use the Drop Dash maneuver. + + Input Arguments:- + player - Player to check. + + Return:- + Whether a Drop Dash should be allowed. +--------------------------------------------------*/ +static boolean K_CanDropDash(player_t *player) +{ + const UINT16 buttons = K_GetKartButtons(player); + + if (!(buttons & BT_ACCELERATE)) + { + return false; + } + + // Since we're letting players spin out on respawn, don't let them charge a dropdash in this state. (It wouldn't work anyway) + if (player->spinouttimer) + { + return false; + } + + // Garden Top is overpowered enough + if (player->curshield == KSHIELD_TOP) + { + return false; + } + + return true; +} + + /*-------------------------------------------------- static void K_HandleDropDash(player_t *player) @@ -699,7 +735,7 @@ static void K_HandleDropDash(player_t *player) // The old behavior was stupid and prone to accidental usage. // Let's rip off Mania instead, and turn this into a Drop Dash! - if ((buttons & BT_ACCELERATE) && !player->spinouttimer) // Since we're letting players spin out on respawn, don't let them charge a dropdash in this state. (It wouldn't work anyway) + if (K_CanDropDash(player)) { player->respawn.dropdash++; }