Fix #552 Impossible to stop helicopter rotor if it has a driver#3621
Fix #552 Impossible to stop helicopter rotor if it has a driver#3621botder merged 13 commits intomultitheftauto:masterfrom
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
stopRotorparameter 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.