-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update race_client.lua #605
base: master
Are you sure you want to change the base?
Conversation
Fixed checkpoints problem from specting mode. Fixed code by robson from MTA Race community
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.
Fixed checkpoints problem from specting mode.
What does this mean? Can you describe the problem you're trying to fix?
Aside from that, the suggested changes are a little odd; a function definition which is never used, accessing table indexes without verifying they exist, and commented out code - please refer to the code review comments.
setBlipOrdering(checkpoint.blip, 1) | ||
return checkpoint.marker | ||
end | ||
|
||
function createRadarBlips(i) |
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.
if (#g_Checkpoints - i) >= 3 then | ||
--destroyElement(blip2.blip2) | ||
if isElement(blip3.blip2) then | ||
if blip3.blip2 then | ||
destroyElement(blip3.blip2) | ||
end | ||
end | ||
end | ||
|
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.
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 blip
and checkpoint
is confusing. You're getting a checkpoint from g_Checkpoints
, not a blip - so these vars should be local checkpoint2
, local checkpoint3
, etc.
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.
--destroyElement(blip2.blip2)
we should also not be submitting commented out code
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.
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
The issue is about the destroyElement error warning in blips on debugscript, which occurs when you are respawning back into the race or spectating a player. Layers that you should test the both codes at online races and check it |
Fixed checkpoints problem from specting mode.
Fixed code by robson from MTA Race community