Skip to content

Commit

Permalink
fix: track preview not being cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
Coffeelot committed Nov 9, 2024
1 parent 836746b commit 1fefe6b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,6 @@ local function updateGpsForRace(started)
local checkpointIndex = isCircuit and ((i - 1) % totalCheckpoints) + 1 or i
if checkpointIndex > totalCheckpoints then break end -- Stop if beyond the last checkpoint in a sprint

print('current checkpoint', currentCheckpoint)
print('checkpoint index', checkpointIndex)
print('last checkpoint', lastCheckpoint)
if not isCircuit or (isCircuit and ((checkpointIndex >= currentCheckpoint and checkpointIndex <= lastCheckpoint) or checkpointIndex == 1)) then
local checkpointData = CurrentRaceData.Checkpoints[checkpointIndex]

Expand Down Expand Up @@ -615,7 +612,6 @@ local function addCheckpoint(checkpointId)
redrawBlips()
end


local function moveCheckpoint()
local dialog

Expand Down Expand Up @@ -1645,13 +1641,14 @@ RegisterNetEvent('cw-racingapp:client:updateOrganizer', function(RaceId, organiz
end
end)

RegisterNetEvent('cw-racingapp:client:leaveRace', function(data)
RegisterNetEvent('cw-racingapp:client:leaveRace', function()
if IgnoreRoadsForGps then
ClearGpsCustomRoute()
else
ClearGpsMultiRoute()
end
Countdown = 10
hideTrack()
updateCountdown(-1)
unGhostPlayer()
deleteCurrentRaceCheckpoints()
Expand Down

0 comments on commit 1fefe6b

Please sign in to comment.