K_GetPlayerNextWaypoint: use player's current waypoint as a hint

Improves best waypoint search time on huge maps with many
waypoints, such as City Escape.
This commit is contained in:
James R 2023-03-31 01:42:38 -07:00
parent 71626dbc76
commit bd7613cd09

View file

@ -8358,7 +8358,7 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
if ((player != NULL) && (player->mo != NULL) && (P_MobjWasRemoved(player->mo) == false))
{
waypoint_t *waypoint = K_GetBestWaypointForMobj(player->mo, NULL);
waypoint_t *waypoint = K_GetBestWaypointForMobj(player->mo, player->currentwaypoint);
boolean updaterespawn = false;
// Our current waypoint.