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

freeroam: bugfix on fr_client.lua onExitVehicle function #571

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

kutlu35
Copy link
Contributor

@kutlu35 kutlu35 commented Nov 1, 2024

There is no point of putting 'elseif' on that spesific place, it causes problems with anti-ramming system since it actually blocks the setVehicleGhost(vehicle,hasDriverGhost(vehicle)), it should be 'end if' instead. That way when driver of the vehicle exits the vehicle, ghostmode vehicle can be back to it's normal state.

VIDEO of the bug: https://youtu.be/ZRFNxSeI1Eo

There is no point of putting 'elseif' on that spesific place, it should be 'end if' instead.
@Dark-Dragon
Copy link
Contributor

While that bit in the code seems to be structured more confusingly than necessary, I believe the point is to have the bottom part only apply for cases where it's not the vehicle of the local player and only for the "onClientPlayerVehicleExit" event. Whether that's important for the functionality of the script I'd need to test, but I wouldn't really agree that there is 'no point' unless you can provide more of an explanation.

@kutlu35
Copy link
Contributor Author

kutlu35 commented Nov 2, 2024

While that bit in the code seems to be structured more confusingly than necessary, I believe the point is to have the bottom part only apply for cases where it's not the vehicle of the local player and only for the "onClientPlayerVehicleExit" event. Whether that's important for the functionality of the script I'd need to test, but I wouldn't really agree that there is 'no point' unless you can provide more of an explanation.

First part of the function is for destroying freeroam panel buttons such as 'repair', 'flip', 'color' when localPlayer exits vehicle, bottom part of the function is actually for changing the data of the vehicle when the DRIVER of the vehicle (seat == 0) exits the vehicle. For example we got "setVehicleGhost(vehicle,hasDriverGhost(vehicle))" there, this makes ghost vehicle normal vehicle again when a player that ticked 'anti ram' button exits the vehicle, but it won't actually happen. So this bug actually messes up the anti-ramming system. Also you can check the onEnterVehicle function which has same structure but it has "end if" instead of "elseif" and it works perfectly fine.

Here is a video:
https://youtu.be/ZRFNxSeI1Eo

@kutlu35 kutlu35 changed the title freeroam: fix on fr_client.lua onExitVehicle function freeroam: bugfix on fr_client.lua onExitVehicle function Nov 2, 2024
@Dark-Dragon
Copy link
Contributor

With the added context your change seems to restore the intended behavior.

@jlillis jlillis merged commit eb94ca3 into multitheftauto:master Nov 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants