If already on a shortcut, bots can continue to use shortcut waypoints

This commit is contained in:
Sally Cochenour 2020-04-15 22:11:25 -04:00
parent d0a6c43c89
commit cc286fc810

View file

@ -6488,11 +6488,18 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
{
for (i = 0U; i < waypoint->numnextwaypoints; i++)
{
if (K_PlayerUsesBotMovement(player)
&& K_GetWaypointIsShortcut(waypoint->nextwaypoints[i])
&& !K_BotCanTakeCut(player))
if (K_PlayerUsesBotMovement(player) == true
&& K_GetWaypointIsShortcut(waypoint->nextwaypoints[i]) == true
&& K_BotCanTakeCut(player) == false)
{
continue;
// Bots that aren't able to take a shortcut will ignore shortcut waypoints.
// (However, if they're already on a shortcut, then we want them to keep going.)
if (player->nextwaypoint == NULL
|| K_GetWaypointIsShortcut(player->nextwaypoint) == false)
{
continue;
}
}
angletowaypoint = R_PointToAngle2(