fivem
fivem copied to clipboard
tweak(natives-decl): add SET_VEHICLE_CURRENT_GEAR and NEXT_GEAR declarations
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.
- [x] Code explains itself well and/or is documented.
- [x] My commit message explains what the changes do and what they are for.
- [x] No extra compilation warnings are added by these changes.
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
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
I'll handle this, as it partially relates to: https://github.com/citizenfx/fivem/issues/2003#issuecomment-1921695915
i dont think it relates to that this is a separate thing
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.
well i can tell you they do work , because i tested them
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.
any updates on this has anyone checked the natives
whats going on with this PR
Can you change the git commit text to
tweak(natives-decl): add SET_VEHICLE_CURRENT_GEAR and NEXT_GEAR declarations
?
Otherwise we have to do that manually.
We will do it manually.
Merged https://github.com/citizenfx/fivem/commit/0a85132958c5b380b7e0648ebdabb10fa1203bed