From cc286fc8107ec269676d8402de5a4a939b753ac5 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Wed, 15 Apr 2020 22:11:25 -0400 Subject: [PATCH] If already on a shortcut, bots can continue to use shortcut waypoints --- src/k_kart.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index ee0b9d95c..9594dd4a0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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(