mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-30 06:51:50 +00:00
Turn confirm goes back to neutral when they aren't trying to turn.
This commit is contained in:
parent
64d6453331
commit
b5d7434caa
1 changed files with 18 additions and 0 deletions
18
src/k_bot.c
18
src/k_bot.c
|
|
@ -720,11 +720,15 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
// Complete override of all ticcmd functionality
|
||||
if (LUAh_BotTiccmd(player, cmd))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Start boost handler
|
||||
if (leveltime <= starttime)
|
||||
{
|
||||
// TODO: Move towards finish line during position, but not too close.
|
||||
|
||||
tic_t length = (TICRATE/6);
|
||||
tic_t boosthold = starttime - K_GetSpindashChargeTime(player);
|
||||
|
||||
|
|
@ -869,6 +873,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
if (turnamt > 0)
|
||||
{
|
||||
// Count up
|
||||
if (player->botvars.turnconfirm < BOTTURNCONFIRM)
|
||||
{
|
||||
player->botvars.turnconfirm++;
|
||||
|
|
@ -876,11 +881,24 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
else if (turnamt < 0)
|
||||
{
|
||||
// Count down
|
||||
if (player->botvars.turnconfirm > -BOTTURNCONFIRM)
|
||||
{
|
||||
player->botvars.turnconfirm--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Back to neutral
|
||||
if (player->botvars.turnconfirm < 0)
|
||||
{
|
||||
player->botvars.turnconfirm++;
|
||||
}
|
||||
else if (player->botvars.turnconfirm > 0)
|
||||
{
|
||||
player->botvars.turnconfirm--;
|
||||
}
|
||||
}
|
||||
|
||||
if (abs(player->botvars.turnconfirm) >= BOTTURNCONFIRM)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue