Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Santiii733
Copy link

Fixed checkpoints problem from specting mode.

Fixed code by robson from MTA Race community

Fixed checkpoints problem from specting mode.

Fixed code by robson from MTA Race community
Copy link
Member

@Lpsd Lpsd left a 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)
Copy link
Member

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?

Copy link
Author

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.

Comment on lines +1310 to +1318
if (#g_Checkpoints - i) >= 3 then
--destroyElement(blip2.blip2)
if isElement(blip3.blip2) then
if blip3.blip2 then
destroyElement(blip3.blip2)
end
end
end

Copy link
Member

@Lpsd Lpsd Mar 4, 2025

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.

Copy link
Member

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

Copy link
Author

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

@Santiii733
Copy link
Author

Santiii733 commented Mar 5, 2025

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.

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants