Skip to content

Add spawnFlyingComponent argument to setVehicleWheelStates() #2128

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

Closed

Conversation

PlatinMTA
Copy link
Contributor

@PlatinMTA PlatinMTA commented Mar 18, 2021

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!

@patrikjuvonen patrikjuvonen added the enhancement New feature or request label Mar 18, 2021
@Pirulax
Copy link
Contributor

Pirulax commented Mar 19, 2021

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?

Copy link
Contributor

@Pirulax Pirulax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR would've been easier to review if you set a default value for spawnFlyingComponent.
Next time please try to keep code changes to minimal.
But thanks for the PR! I dont see any glaring issues.

@PlatinMTA
Copy link
Contributor Author

PlatinMTA commented Mar 19, 2021

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?

@patrikjuvonen patrikjuvonen added this to the Next Release (1.6.1) milestone Apr 8, 2023
Pushed to last, didn't test, for some reason custom builds crash on my PC now
@Proxy-99
Copy link
Contributor

Proxy-99 commented Oct 4, 2024

why this pr is not merged until now

@FileEX
Copy link
Contributor

FileEX commented Oct 8, 2024

why this pr is not merged until now

I think this PR can be closed because #3592 is doing the job

@Fernando-A-Rocha
Copy link
Contributor

indeed this can be closed as #3592 has already been merged

@botder botder closed this Dec 31, 2024
@PlatinMTA PlatinMTA deleted the wheelStates_SpawnFlying branch March 29, 2025 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants