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.
This commit is contained in:
Sally Coolatta 2022-09-10 03:52:31 -04:00 committed by NepDisk
parent 5c1b15aeb6
commit 7edc6df916

View file

@ -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
);