Fix ZR-350 pop up headlights not working on custom vehicle models - #5162
Open
TheCrazy17 wants to merge 1 commit into
Open
Fix ZR-350 pop up headlights not working on custom vehicle models#5162TheCrazy17 wants to merge 1 commit into
TheCrazy17 wants to merge 1 commit into
Conversation
PreRender only swings the misc_a component and DoVehicleLights only waits on it for model 477, so a clone carrying its own ID skipped both and its headlights stayed shut; both checks now also accept the model a clone was cloned from.
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
The ZR-350's pop up headlights, misc_a swinging out before the lights turn on, now work on a clone of the model created with engineRequestModel, exactly as they do on the stock 477.
Motivation
Part of #1861. CAutomobile::PreRender only swings the misc_a component for model 477, and CVehicle::DoVehicleLights only waits for that swing to finish before turning the headlights on for model 477 too. A model created by engineRequestModel carries an ID of its own, so a cloned ZR-350 matches neither check and its headlights stay shut and never light up.
Both checks now also accept the model the clone was cloned from, so a clone behaves exactly like the stock car and everything else is untouched.
Test plan
Clone model 477 with engineRequestModel, replace it with the DFF and TXD, and setElementModel a vehicle to it. Confirm the headlights swing out and light up when turned on, and swing back in when turned off, same as an unmodified ZR-350.
Checklist