Add spawnFlyingComponent argument to setVehicleWheelStates()
This pull request is related to #2121. I could work in #2122 as well but I don't promise anything.
Now setVehicleWheelStates has a new boolean argument called spawnFlyingComponent just like setVehicleDoorState. If it is set to true and a wheel is changed to 2 then it will make the wheel visually detach from the vehicle like in this video: https://youtu.be/1zpKGbvpbnY
bool setVehicleWheelStates ( vehicle theVehicle, int frontLeft, [ int rearLeft = -1, int frontRight = -1, int rearRight = -1, bool spawnFlyingComponent = false ])
I would really check twice this pull before mergin it. It is my first time pulling to MTA and I could be breaking the Coding Guidelines or doing something that is not the smartest.
Thank you!
In the video I saw you had to interact with the vehicle to make it recalculate the physics. Is there a way to do that automatically?
In the video I saw you had to interact with the vehicle to make it recalculate the physics. Is there a way to do that automatically?
I don't actually know. This has been default behaviour since forever, but it's inconsistent, sometimes it just falls down when other times it just mantains like that until you interact with the vehicle (even if you deleted all 4 wheels). When driving it does not happen tho.
I'll see what you reviewed in a moment, thanks.
EDIT:
This PR would've been easier to review if you set a default value for
spawnFlyingComponent.
What should I do next time? I didn't understand what are you referring to. Just in case the default value is false so it doesn't break backwards compatibility.
Also, shouldn't I edit the version.h file because I edited bistream.h?
why this pr is not merged until now
why this pr is not merged until now
I think this PR can be closed because #3592 is doing the job
indeed this can be closed as #3592 has already been merged