From 49e72d15c5e3a2ee03f608f270e15d89221003b6 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Thu, 2 Oct 2025 17:29:15 -0400 Subject: [PATCH] Fix DTF failing if shortcut path is the only path --- src/k_kart.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index fed66723e..be3e76504 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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)