-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Fix #552 Impossible to stop helicopter rotor if it has a driver #3621
base: master
Are you sure you want to change the base?
Conversation
Will it work with planes, or only helicopters? |
This PR only applies to helicopters. Does the same bug apply to planes? |
Yep, same. At the moment, rotor can be stopped only in preRender. Im ask because PR #2548 add combined method for set/get heli/plane rotor speed. |
What may be broken? |
As far as I know, the MTA team strongly attaches importance to backward compatibility. In this case, various scripts using setVehicleEngineState could cause the helicopter's rotor to stop, and while this is perfectly desirable behavior for us, it may be undesirable for others. So I personally think it's safer and better to just add these simple functions |
I took this into account and introduced |
Fixed #552
This PR add two new functions
This function works in a similar way to
setVehicleEngineState
.By specifying state to false, the rotor will not be processed, i.e. it will not change its speed and the helicopter/plane cannot be controlled.
The
stopRotor
parameter specifies whether the rotor is to be stopped (SetHeliRotorSpeed to 0). If we specify false, the rotor will not change its speed, but will not be stopped, it will rotate at the same speed all the time.Of course, instead of adding new functions, we could use
setVehicleEngineState
, but for backward compatibility reasons it is better not to do this and simply add these two new functions to avoid possible problems with older scripts.This function also allows to achieve the effect that the rotor rotates even without a driver.