-
-
Notifications
You must be signed in to change notification settings - Fork 168
Update race_client.lua #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1259,11 +1259,24 @@ function createCheckpoint(i) | |
if checkpoint.type == 'ring' and i < #g_Checkpoints then | ||
setMarkerTarget(checkpoint.marker, unpack(g_Checkpoints[i+1].position)) | ||
end | ||
checkpoint.blip = createBlip(pos[1], pos[2], pos[3], 0, isCurrent and 2 or 1, color[1], color[2], color[3]) | ||
checkpoint.blip = createBlip(pos[1], pos[2], pos[3], 0, isCurrent and 2 or 1, color[1], color[2], color[3], 255) | ||
setBlipOrdering(checkpoint.blip, 1) | ||
return checkpoint.marker | ||
end | ||
|
||
function createRadarBlips(i) | ||
local checkpoint = g_Checkpoints[i] | ||
if checkpoint.marker then | ||
return | ||
end | ||
local pos = checkpoint.position | ||
local color = checkpoint.color or { 0, 0, 80 } | ||
|
||
checkpoint.blip2 = createBlip(pos[1], pos[2], pos[3], 0, isCurrent and 2 or 1, color[1], color[2], color[3], 100) | ||
|
||
return checkpoint.marker | ||
end | ||
|
||
function makeCheckpointCurrent(i,bOtherPlayer) | ||
local checkpoint = g_Checkpoints[i] | ||
local pos = checkpoint.position | ||
|
@@ -1287,10 +1300,22 @@ end | |
|
||
function destroyCheckpoint(i) | ||
local checkpoint = g_Checkpoints[i] | ||
local blip2 = g_Checkpoints[i+1] | ||
local blip3 = g_Checkpoints[i+2] | ||
if checkpoint and checkpoint.marker then | ||
destroyElement(checkpoint.marker) | ||
checkpoint.marker = nil | ||
destroyElement(checkpoint.blip) | ||
|
||
if (#g_Checkpoints - i) >= 3 then | ||
--destroyElement(blip2.blip2) | ||
if isElement(blip3.blip2) then | ||
if blip3.blip2 then | ||
destroyElement(blip3.blip2) | ||
end | ||
end | ||
end | ||
|
||
Comment on lines
+1310
to
+1318
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These blips are not guaranteed to exist with the current logic, yet you aren't checking if they do exist. What happens if the last checkpoint in the table was destroyed, but more than 2 checkpoints exist? Also the inconsistent usage of terms There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The codebase from vanilla mta itself throws a warning on -destroyelement, so you should check how to fix that problem. Cause problems on specting mode |
||
checkpoint.blip = nil | ||
if checkpoint.colshape then | ||
destroyElement(checkpoint.colshape) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this function defined but not used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nowadays, we use 3 blips in the race community, to accurately see the next 3cp from a distance.