Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(game/five): fix vehicle cloth not rendering #2988

Closed
wants to merge 1 commit into from

Conversation

alexguirre
Copy link

Goal of this PR

The patch introduced in 4f294e4 was checking type != 3 instead of the intended type == 3, which disabled the vehicle cloth rendering.

How is this PR achieving the goal

Correct the patch to check for type == 3.

This PR applies to the following area(s)

FiveM

Successfully tested on

Game builds: 3258

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

Fixes #2977.

This patch was checking `type != 3` instead of the intended `type == 3`,
which disabled the vehicle cloth rendering.
@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Dec 7, 2024
@slashkeyvalue
Copy link
Contributor

That patch is being revisited as i've chatted with dalekenium a bit about it, it was supposed to fix a crash and it did fix it in some away by being wrong

@dalekenium-cfx
Copy link
Contributor

As @slashkeyvalue said, the incorrect instruction jz does fix the crash, however this is because it prevents all instances of cloth sims on vehicles from rendering. As stated in this PR, the intention of the patch was to only render the cloth sims if the shader type is 3 (VEHICLE).

With the jz switched to jnz, vehicle cloth sims now render correctly but the crash with parachute model overrides still occurs. Even when the model's parent entity is not a vehicle, the shader still has type VEHICLE; thus, the renderer still attempts to access the parent entity as a vehicle, which causes undefined behavior that inevitably leads to a crash.

We are currently working on a proper fix for the crash that also preserves vehicle cloth sims, so I am going to close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vehicle Flags stopped working
3 participants