From 3a5f8bf0e7a998f2fa6c0cb084ab7dfe040af9fc Mon Sep 17 00:00:00 2001 From: NepDisk <16447892+NepDisk@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:29:25 -0400 Subject: [PATCH] Move these to the right spots --- src/k_waypoint.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/k_waypoint.c b/src/k_waypoint.c index 73b2b376b..ad1a9bddf 100644 --- a/src/k_waypoint.c +++ b/src/k_waypoint.c @@ -1973,8 +1973,6 @@ static UINT32 K_SetupCircuitLength(void) if ((mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) == LF_SECTIONRACE) { path_t bestsprintpath = {0}; - - Z_Free(bestsprintpath.array); const boolean useshortcuts = false; const boolean huntbackwards = true; const UINT32 traveldist = UINT32_MAX - UINT16_MAX; // Go as far back as possible. Not exactly UINT32_MAX to avoid possible overflow. @@ -1991,6 +1989,7 @@ static UINT32 K_SetupCircuitLength(void) { startingwaypoint = (waypoint_t *)bestsprintpath.array[ bestsprintpath.numnodes - 1 ].nodedata; } + Z_Free(bestsprintpath.array); } else @@ -1999,8 +1998,6 @@ static UINT32 K_SetupCircuitLength(void) waypoint_t fakefinishline = *finishline; path_t bestcircuitpath = {0}; - - Z_Free(bestcircuitpath.array); const boolean useshortcuts = false; const boolean huntbackwards = false; @@ -2014,7 +2011,7 @@ static UINT32 K_SetupCircuitLength(void) // this instead would be the most ideal startingwaypoint = finishline->nextwaypoints[0]; } - + Z_Free(bestcircuitpath.array); } return circuitlength;