diff --git a/src/k_bot.cpp b/src/k_bot.cpp index f79e94cbe..7afe53e5c 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -1931,7 +1931,14 @@ void K_UpdateBotGameplayVars(player_t *player) } else { - player->botvars.spindashconfirm += player->cmd.bot.spindashconfirm; + if (player->cmd.bot.spindashconfirm < 0 && abs(player->cmd.bot.spindashconfirm) > player->botvars.spindashconfirm) + { + player->botvars.spindashconfirm = 0; + } + else + { + player->botvars.spindashconfirm += player->cmd.bot.spindashconfirm; + } } if (K_TryRingShooter(player) == true) diff --git a/src/k_botitem.cpp b/src/k_botitem.cpp index 1d8ba9360..84baaab6b 100644 --- a/src/k_botitem.cpp +++ b/src/k_botitem.cpp @@ -1812,13 +1812,71 @@ void K_UpdateBotGameplayVarsItemUsage(player_t *player) return; } - player->botvars.itemconfirm += player->cmd.bot.itemconfirm; - - if (player->itemRoulette.active == true) + if (player->cmd.bot.itemconfirm < 0 && abs(player->cmd.bot.itemconfirm) > player->botvars.itemconfirm) { - // Mashing behaviors - K_UpdateBotGameplayVarsItemUsageMash(player); - return; + player->botvars.itemconfirm = 0; + } + else + { + player->botvars.itemconfirm += player->cmd.bot.itemconfirm; + } + + if (player->itemflags & IF_USERINGS) + { + ; + } + else + { + if (player->itemRoulette.active == true) + { + // Mashing behaviors + K_UpdateBotGameplayVarsItemUsageMash(player); + return; + } + + if (player->stealingtimer == 0) + { + if (player->eggmanexplode) + { + ; + } + else if (player->itemflags & IF_EGGMANOUT) + { + ; + } + else if (player->rocketsneakertimer > 0) + { + ; + } + else + { + switch (player->itemtype) + { + default: + { + break; + } + case KITEM_FLAMESHIELD: + { + if (player->botvars.itemconfirm == 0 + && (player->itemflags & IF_HOLDREADY) == IF_HOLDREADY) + { + INT32 flamemax = player->flamelength; + + if (player->flamemeter < flamemax || flamemax == 0) + { + ; + } + else + { + player->botvars.itemconfirm = (3 * flamemax / 4) + (TICRATE / 2); + } + } + break; + } + } + } + } } } diff --git a/src/k_kart.c b/src/k_kart.c index 2ebc91b31..def73ecfd 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -12288,7 +12288,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else { player->itemflags |= IF_HOLDREADY; - player->botvars.itemconfirm = 3*flamemax/4; if (!(gametyperules & GTR_CLOSERPLAYERS) || leveltime % 6 == 0) {