From 2d8461a59d0cfca0b2bd4a9c39a43ab6a42f1557 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 1 May 2019 23:56:12 -0400 Subject: [PATCH] Port over double-press Grow cancel from internal --- src/k_kart.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b826d628..ba15882f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2141,7 +2141,7 @@ static void K_RemoveGrowShrink(player_t *player) } player->kartstuff[k_growshrinktimer] = 0; - player->kartstuff[k_growcancel] = 0; + player->kartstuff[k_growcancel] = -1; P_RestoreMusic(player); } @@ -5311,14 +5311,24 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Grow Canceling else if (player->kartstuff[k_growshrinktimer] > 0) { - if (cmd->buttons & BT_ATTACK) + if (player->kartstuff[k_growcancel] >= 0) { - player->kartstuff[k_growcancel]++; - if (player->kartstuff[k_growcancel] > 26) - K_RemoveGrowShrink(player); + if (cmd->buttons & BT_ATTACK) + { + player->kartstuff[k_growcancel]++; + if (player->kartstuff[k_growcancel] > 26) + K_RemoveGrowShrink(player); + } + else + player->kartstuff[k_growcancel] = 0; } else - player->kartstuff[k_growcancel] = 0; + { + if ((cmd->buttons & BT_ATTACK) || (player->pflags & PF_ATTACKDOWN)) + player->kartstuff[k_growcancel] = -1; + else + player->kartstuff[k_growcancel] = 0; + } } else if (player->kartstuff[k_itemamount] <= 0) { @@ -5683,7 +5693,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_curshield] = 0; if (player->kartstuff[k_growshrinktimer] <= 0) - player->kartstuff[k_growcancel] = 0; + player->kartstuff[k_growcancel] = -1; if (player->kartstuff[k_itemtype] == KITEM_SPB || player->kartstuff[k_itemtype] == KITEM_SHRINK @@ -6868,7 +6878,7 @@ static void K_drawKartItem(void) } else if (stplyr->kartstuff[k_growshrinktimer] > 0) { - if (stplyr->kartstuff[k_growcancel]) + if (stplyr->kartstuff[k_growcancel] > 0) { itembar = stplyr->kartstuff[k_growcancel]; maxl = 26;