Skip to content

Fix ZR-350 pop up headlights not working on custom vehicle models - #5162

Open
TheCrazy17 wants to merge 1 commit into
multitheftauto:masterfrom
TheCrazy17:fix/zr350-headlights-custom-models
Open

Fix ZR-350 pop up headlights not working on custom vehicle models#5162
TheCrazy17 wants to merge 1 commit into
multitheftauto:masterfrom
TheCrazy17:fix/zr350-headlights-custom-models

Conversation

@TheCrazy17

Copy link
Copy Markdown
Contributor

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

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit by commit.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant