mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
K_BuildBotTiccmd: Catch NULL track predictions
Predict can be NULL if the bot's nextwaypoint is NULL, which happens consistently at the beginning of Speed Highway and can sometimes also occour on other otherwise functionally-waypointed sprint courses.
This commit is contained in:
parent
f57dd43e36
commit
917062b6c6
1 changed files with 12 additions and 3 deletions
15
src/k_bot.c
15
src/k_bot.c
|
|
@ -1397,7 +1397,10 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
|
||||
if (predict != NULL)
|
||||
{
|
||||
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
|
||||
}
|
||||
cmd->buttons &= ~(BT_ACCELERATE|BT_BRAKE);
|
||||
cmd->forwardmove = 0;
|
||||
trySpindash = true;
|
||||
|
|
@ -1431,7 +1434,10 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
|
||||
if (predict != NULL)
|
||||
{
|
||||
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1450,7 +1456,10 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
|
||||
if (predict != NULL)
|
||||
{
|
||||
turnamt = K_HandleBotTrack(player, cmd, predict, destangle);
|
||||
}
|
||||
}
|
||||
|
||||
if (trySpindash == true)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue