Fix vehicle door model flags not applying via setVehicleHandling - #5294
Open
TheCrazy17 wants to merge 3 commits into
Open
Fix vehicle door model flags not applying via setVehicleHandling#5294TheCrazy17 wants to merge 3 commits into
TheCrazy17 wants to merge 3 commits into
Conversation
Contributor
|
Thank you bro, this has been driving me insane. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GTA:SA only applies these handling model flags once, inside the vehicle's native constructor, so a live handling change (or a vehicle simply spawning through MTA's own creation path) never picked them up correctly:
reverse_bonnet: bonnet hinges and opens the other way around instead of the default direction.hanging_boot: boot hangs open instead of swinging like a rigid lid.tailgate_boot: boot opens like a pickup style tailgate instead of a regular lid.no_doors: marks the four side doors as missing; meant for vehicles with no door model at all, like the RC cars.This PR recalculates the bonnet and boot hinge setup whenever handling changes, the same way an existing fix already does for the swinging chassis flag. It also fixes the order handling gets reapplied on stream in, since restoring a door's open ratio before the hinge fix ran baked in the wrong angle.
no_doorsadditionally hides the door mesh directly, since a locked vehicle's front doors were quietly turning the request into a dent instead of hiding it.Example of

reverse_bonnet:Motivation
Related to #1993, which lists several handling flags that have a real effect in game but can't be applied through scripting. This PR resolves
no_doorsfrom that list;reverse_bonnet,hanging_bootandtailgate_bootshare the exact same root cause and are fixed alongside it.Also, requested by, and made with care for, @rxyyy
Test plan
setVehicleHandling/setModelHandlingon a normal car and confirmed the bonnet/boot now open the correct way, and side doors disappear forno_doors, including on a locked vehicle.reverse_bonnetby default (Enforcer looks like its bugged by default, Firetruck, Tractor, SWAT Van) open correctly too.Checklist