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

tweak(natives-decl): add SET_VEHICLE_CURRENT_GEAR and NEXT_GEAR declarations #2404

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

Conversation

RickyB505
Copy link
Contributor

@RickyB505 RickyB505 commented Feb 27, 2024

Goal of this PR

This will allow developers to create manual transmissions more easily with in FiveM.

How is this PR achieving the goal

Adds two natives SetVehicleCurrentGear(vehicle, gear) and SetVehicleNextGear(vehicle, nextGear) that exist with in VehicleExtraNatives.cpp but were never added.

This PR applies to the following area(s)

FiveM, Vehicles

Successfully tested on

Should work on any build.

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@thorium-cfx thorium-cfx added the triage Needs a preliminary assessment to determine the urgency and required action label Feb 27, 2024
@thorium-cfx
Copy link
Contributor

Can you change the commit title to something like: tweak(natives-decl): add SET_VEHICLE_CURRENT_GEAR and NEXT_GEAR declarations? For the rest I've assigned @4mmonium, he's good at checking these

@RickyB505 RickyB505 changed the title added two missing natives tweak(natives-decl): add SET_VEHICLE_CURRENT_GEAR and NEXT_GEAR declarations Feb 27, 2024
@RickyB505
Copy link
Contributor Author

Can you change the commit title to something like: tweak(natives-decl): add SET_VEHICLE_CURRENT_GEAR and NEXT_GEAR declarations? For the rest I've assigned @4mmonium, he's good at checking these
fixed

@gottfriedleibniz
Copy link
Contributor

I'll handle this, as it partially relates to: #2003 (comment)

@RickyB505
Copy link
Contributor Author

RickyB505 commented Feb 27, 2024

i dont think it relates to that this is a separate thing

@gottfriedleibniz
Copy link
Contributor

Much of CTransmission changed in 3095 and it is likely required to sanitize those setters against 0x61F02E4E9A7A61EA (nInitialDriveGears in CHandling iirc). It would be nice to ensure that is validated/handled prior to native declarations being provided.

@RickyB505
Copy link
Contributor Author

well i can tell you they do work , because i tested them

@4mmonium
Copy link

4mmonium commented Mar 1, 2024

Can you change the commit title to something like: tweak(natives-decl): add SET_VEHICLE_CURRENT_GEAR and NEXT_GEAR declarations? For the rest I've assigned @4mmonium, he's good at checking these

Doc implementation seems fine, now for underlying implementation @gottfriedleibniz might know better than I do; so as they stated, they should handle the rest 🙂

well i can tell you they do work , because i tested them

That's great, but structure changes between builds can cause memory related issues nonetheless (such as invalid data, crashes from invalid pointer access, etc), offsets that were valid in the past, might no longer be. So it's important to check the underlying implementation to make sure these things don't happen.

@RickyB505
Copy link
Contributor Author

any updates on this has anyone checked the natives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants