From 7edc6df916d99475e42e975ebdd3922c407b34e4 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sat, 10 Sep 2022 03:52:31 -0400 Subject: [PATCH] Circuit pathfinding An alternative to the standard pathfind function. Instead of pathfinding to a specific waypoint, it always goes towards the finish line waypoint, but also won't stop when it reaches it. It only stops when it travels a far enough distance. This is basically a cleaner, less hacky, and optimized version of the pathfinding I gave to the bots; instead of doing 1-2 full pathfinds to do this (depending on if they are near the finish line or not), it will instead always do a single small pathfind. I also need it for shrink laser behavior. --- src/k_bot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_bot.c b/src/k_bot.c index 4274ef33d..3aacc077a 100644 --- a/src/k_bot.c +++ b/src/k_bot.c @@ -769,7 +769,7 @@ static botprediction_t *K_CreateBotPrediction(player_t *player) distscaled = K_ScaleWPDistWithSlope(disttonext, angletonext, nextslope, P_MobjFlip(wp->mobj)) / FRACUNIT; pathfindsuccess = K_PathfindThruCircuit( - wp, (unsigned)distanceleft, + player->nextwaypoint, (unsigned)distanceleft, &pathtofinish, useshortcuts, huntbackwards );