Add spawnFlyingComponent & breakGlass arguments for setVehiclePanelState
This PR adds the spawnFlyingComponent argument (defaulting to true) to setVehiclePanelState, similar to what is available in setVehicleDoorState. Additionally, the PR introduces the feature to shatter the windscreen if windscreen_panel is set to 3; currently, the windscreen simply disappears.
Added breakGlass argument.
bool setVehiclePanelState(vehicle theVehicle, int panelID, int state [ , bool spawnFlyingComponent = true, bool breakGlass = false ] )
https://streamable.com/uxpph6
This PR helps avoid frustrating situations, such as when managing a garage of vehicles and changing their models.
Closes #2122
Well done!
I added the breakGlass argument because the glass component does fall out (but it is poorly visible and falls underground). To maintain backward compatibility, the glass will fall out as before. If breakGlass is set to true, the glass will not fall out but will break as in the video.
#3592 already adds spawnVehicleFlyingComponent so i think this PR should only add breakGlass ?
#3592 already adds spawnVehicleFlyingComponent so i think this PR should only add breakGlass ?
The spawnVehicleFlyingComponent function allows you to create components, while the argument in the setVehiclePanelState function allows you to avoid creating them. By default, after calling the function, for example, the bumper is flying, which I showed in the screenshots and it can be annoying. It works exactly the same way as in the case of setVehicleDoorState. This argument is not intended to spawn components, but to not spawn them if someone does not want it, because they are spawned by default
Sorry for the misunderstanding. You are right, this PR is ok
Conflicts resolved