Fix crashes caused by malformed vehicle model replacements#5053
Open
HeresHavi wants to merge 1 commit into
Open
Fix crashes caused by malformed vehicle model replacements#5053HeresHavi wants to merge 1 commit into
HeresHavi wants to merge 1 commit into
Conversation
Prevent crashes from malformed vehicle replacements by validating required model frames, safely handling missing plane nodes, and preserving the previous replacement when a new one fails.
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
Added checks for required model frames before applying custom vehicle replacements.
Bike and BMX replacements now require both wheel frames, while Vortex replacements require the left landing gear frame. Missing plane panel frames are also disabled safely.
Rejected replacements keep the previous working model active and are no longer retried whenever the model streams in.
Motivation
GTA expects certain vehicle types to contain specific model frames. A replacement DFF can load successfully while still missing the frames needed by the vehicle it replaces, causing a crash later when GTA creates or renders it.
For example, a server might use a modified Super GT model as a replacement for a bike or Vortex. When the vehicle streams in, or when a player fires a weapon nearby, GTA can try to use wheel or landing gear frames that do not exist and crash the player's client.
Crash Stacks
Test plan
Runtime
Builds and Tests
Debug | Win32: Full build passed, 304 client tests passed.Release | Win32: Full build passed, 304 client tests passed.Checklist