mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Prevent finishline ever being your prevwaypoint
This commit is contained in:
parent
05e74c3e9d
commit
63ae0ea6bd
2 changed files with 7 additions and 2 deletions
|
|
@ -9067,6 +9067,11 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
|
||||
if (angledelta < nextbestdelta && momdelta < nextbestmomdelta)
|
||||
{
|
||||
if (waypoint->prevwaypoints[i] == finishline) // NEVER allow finish line.
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (P_TraceWaypointTraversal(player->mo, waypoint->prevwaypoints[i]->mobj) == false)
|
||||
{
|
||||
// Save sight checks when all of the other checks pass, so we only do it if we have to
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ waypoint_t *K_GetBestWaypointForMobj(mobj_t *const mobj)
|
|||
// remember: huge radius
|
||||
if (closestdist <= rad && checkdist <= rad && finishline != NULL)
|
||||
{
|
||||
if (!P_TraceBlockingLines(mobj, checkwaypoint->mobj)) // Intentionally not P_TraceWaypointTraversal
|
||||
if (!P_TraceWaypointTraversal(mobj, checkwaypoint->mobj))
|
||||
{
|
||||
// Save sight checks when all of the other checks pass, so we only do it if we have to
|
||||
continue;
|
||||
|
|
@ -379,7 +379,7 @@ waypoint_t *K_GetBestWaypointForMobj(mobj_t *const mobj)
|
|||
}
|
||||
else if (checkdist < closestdist && bestfindist == INT32_MAX)
|
||||
{
|
||||
if (!P_TraceBlockingLines(mobj, checkwaypoint->mobj)) // Intentionally not P_TraceWaypointTraversal
|
||||
if (!P_TraceWaypointTraversal(mobj, checkwaypoint->mobj))
|
||||
{
|
||||
// Save sight checks when all of the other checks pass, so we only do it if we have to
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue