Fix DTF failing if shortcut path is the only path
This commit is contained in:
parent
b860ee3db4
commit
49e72d15c5
1 changed files with 8 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue