Skip to content

Skip passengers in the unoccupied sync distance check - #1288

Open
r4sheed wants to merge 1 commit into
openmultiplayer:masterfrom
r4sheed:fix/unoccupied-passenger-distance
Open

r4sheed wants to merge 1 commit into
openmultiplayer:masterfrom
r4sheed:fix/unoccupied-passenger-distance

Conversation

@r4sheed

@r4sheed r4sheed commented Nov 3, 2026 •

Copy link
Copy Markdown

A player sitting in a vehicle as a passenger can't sync any other unoccupied vehicle: PlayerUnoccupiedSyncHandler drops a SeatID 0 sync from PlayerState_Passenger. But updateFromUnoccupied still counts them when it looks for the closest player. So if a passenger is the closest one to an empty car, nobody's sync gets accepted and the server keeps the car where it was.

To reproduce:

  1. Drive any car with a second player in the passenger seat.
  2. Push an empty car with the passenger's side, so the passenger is closer to it than the driver.
  3. The car moves on your screens, but GetVehiclePos still returns where it stood before the push.

This skips passengers in that loop. Nothing changes when no passenger is closest

Passengers can't send unoccupied sync for seat 0 (it's dropped in PlayerUnoccupiedSyncHandler), but updateFromUnoccupied still counts them when it looks for the closest player. So if a passenger is the closest one to an empty car, nobody's sync gets accepted and the server keeps the car where it was. Easy to hit with a tow truck pushing a car while someone sits in the passenger seat.

This skips passengers in that loop. Nothing changes when no passenger is closest.
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