mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +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
|
// Complete override of all ticcmd functionality
|
||||||
if (LUAh_BotTiccmd(player, cmd))
|
if (LUAh_BotTiccmd(player, cmd))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Start boost handler
|
// Start boost handler
|
||||||
if (leveltime <= starttime)
|
if (leveltime <= starttime)
|
||||||
{
|
{
|
||||||
|
// TODO: Move towards finish line during position, but not too close.
|
||||||
|
|
||||||
tic_t length = (TICRATE/6);
|
tic_t length = (TICRATE/6);
|
||||||
tic_t boosthold = starttime - K_GetSpindashChargeTime(player);
|
tic_t boosthold = starttime - K_GetSpindashChargeTime(player);
|
||||||
|
|
||||||
|
|
@ -869,6 +873,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
|
||||||
|
|
||||||
if (turnamt > 0)
|
if (turnamt > 0)
|
||||||
{
|
{
|
||||||
|
// Count up
|
||||||
if (player->botvars.turnconfirm < BOTTURNCONFIRM)
|
if (player->botvars.turnconfirm < BOTTURNCONFIRM)
|
||||||
{
|
{
|
||||||
player->botvars.turnconfirm++;
|
player->botvars.turnconfirm++;
|
||||||
|
|
@ -876,11 +881,24 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
|
||||||
}
|
}
|
||||||
else if (turnamt < 0)
|
else if (turnamt < 0)
|
||||||
{
|
{
|
||||||
|
// Count down
|
||||||
if (player->botvars.turnconfirm > -BOTTURNCONFIRM)
|
if (player->botvars.turnconfirm > -BOTTURNCONFIRM)
|
||||||
{
|
{
|
||||||
player->botvars.turnconfirm--;
|
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)
|
if (abs(player->botvars.turnconfirm) >= BOTTURNCONFIRM)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue