Fix DTF failing if shortcut path is the only path

This commit is contained in:
NepDisk 2025-10-02 17:29:15 -04:00
parent b860ee3db4
commit 49e72d15c5

View file

@ -8211,6 +8211,14 @@ static void K_UpdateDistanceFromFinishLine(player_t *player)
pathfindsuccess =
K_PathfindToWaypoint(player->nextwaypoint, finishline, &pathtofinish, useshortcuts, huntbackwards);
if (!pathfindsuccess)
{
// We failed...
// Lets try shortcut waypoints if that happens to be the only path.
pathfindsuccess =
K_PathfindToWaypoint(player->nextwaypoint, finishline, &pathtofinish, true, huntbackwards);
}
// Update the player's distance to the finish line if a path was found.
// Using shortcuts won't find a path, so distance won't be updated until the player gets back on track
if (pathfindsuccess == true)