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:
toaster 2023-01-27 19:57:56 +00:00
parent f57dd43e36
commit 917062b6c6

View file

@ -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)