Skip to content

Fix Forklift forks not working on custom vehicle models - #5197

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

Fix Forklift forks not working on custom vehicle models#5197
TheCrazy17 wants to merge 1 commit into
multitheftauto:masterfrom
TheCrazy17:fix/forklift-custom-models

Conversation

@TheCrazy17

Copy link
Copy Markdown
Contributor

Summary

Extends engineRequestModel custom vehicle model support to the Forklift: the forks move, apply force and draw raised on a clone the same way they do on the stock model, and a picked up object rides them, gets the right detach behaviour, and doesn't get crushed instead of carried.

Motivation

Continues the ongoing series of fixes for vehicles with hardcoded native behaviour that engineRequestModel clones don't inherit (#5161, #5162, #5165, #5166, #5171, #5181, #5195).

Part of #1861.

Test plan

Spawned a Forklift clone via engineRequestModel and confirmed in game: the forks raise and lower, push what's in front of them, and pick up loose objects (garbage bags) instead of breaking them; a picked up object rides the forks, stays attached through steep angles, and lets go on its own once lowered. Confirmed the stock Forklift behaves exactly as before.

forklift.zip

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.

The forks never move, apply force or draw raised on a clone, since ProcessControl, UpdateMovingCollision and PreRender all gate on the raw model index. A picked up object is also affected in several places: it doesn't ride the misc_a dummy, isn't exempt from the steep angle auto detach, doesn't let go on its own, gets damaged instead of carried, and the forks don't drop their own collision point once level. Every hook redirects through the clone's parent, verified against the retail disassembly with only the registers each fallthrough actually needs. Picking a ped or object up in the first place is a separate mechanic and stays out of scope.
@Fernando-A-Rocha

Copy link
Copy Markdown
Contributor

Awesome! Are the picked objects synced with other players ?

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.

2 participants