Skip to content

Fix unoccupied vehicle sync list growing unbounded during vehicle exit#5025

Merged
Lpsd merged 1 commit into
multitheftauto:masterfrom
Lpsd:unoccupied-sync-list
Jul 11, 2026
Merged

Fix unoccupied vehicle sync list growing unbounded during vehicle exit#5025
Lpsd merged 1 commit into
multitheftauto:masterfrom
Lpsd:unoccupied-sync-list

Conversation

@Lpsd

@Lpsd Lpsd commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

Fix unoccupied vehicle sync list growing unbounded during vehicle exit

Motivation

After a player exits a vehicle, the server can spam "WARN: Received excess unoccupied vehicle sync data". This can be reproduced simply by exiting and re-entering a stationary vehicle, after which driving triggers the warning.

image

In CUnoccupiedVehicleSync::UpdateStates, the exiting vehicle is meant to be temporarily added to m_List before sending a sync packet and then removed immediately after. The removal relies on the outer pVehicle pointer, but the inner if statement declares a new shadow variable, leaving the outer as nullptr.

As a result the cleanup never ran and the vehicle was pushed into the list on every sync tick for the entire duration of the exit animation, producing packets with hundreds of duplicate entries.

The fix assigns to the outer pVehicle instead of shadowing it, so the existing removal code at the bottom of the function works as intended.

Test plan

Exit a vehicle, re-enter it, and drive. Confirm the server no longer logs the excess sync warning.

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.

@Lpsd Lpsd merged commit 6bbb61b into multitheftauto:master Jul 11, 2026
10 checks passed
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