Skip to content

Fix #529: Player falls off his bike when it is teleported - #5422

Open
iManGaaX wants to merge 1 commit into
multitheftauto:masterfrom
iManGaaX:resolve/issue-529
Open

iManGaaX wants to merge 1 commit into
multitheftauto:masterfrom
iManGaaX:resolve/issue-529

Conversation

@iManGaaX

Copy link
Copy Markdown
Contributor

Summary

When a vehicle is moved more than 10 units in one go, CVehicleSA::OnChangingPosition repositions its wheel collision points so the physics doesn't keep working with the ground contacts of the old location; that handling only covered CAutomobile (base vehicle type 0), but bikes (CBike = 9, CBmx = 10) keep their own copy of those colpoints; so after a far teleport a bike was still using the contacts of its old position, which made the physics go wild and knock the rider off

Changes

  • CBikeSA.h: m_anWheelColPoint is declared as CColPointSAInterface[4] instead of raw bytes (same size and offsets, the sizeof == 0x814 assert still guards the layout)

  • CVehicleSA.cpp: reposition the bike wheel colpoints on big moves, exactly like it is already done for automobiles

Closes #529.

Before ->

2026-09-16.09-24-24.mp4

After ->

2026-09-16.09-25-55.mp4

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.

@iManGaaX iManGaaX changed the title Fix #529: Player falls off his bike when it is teleported by setElementPosition Fix #529: Player falls off his bike when it is teleported Sep 17, 2026
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.

Player falls from his bike when its teleported by setElementPosition

1 participant