Skip to content

Conversation

@DaniGP17
Copy link
Contributor

Goal of this PR

Fixes a bug where vehicle entities become stuck/frozen after players change routing buckets or disconnect. The issue occurred when entity ownership was incorrectly transferred to players outside of OneSync range, causing entities to be uninteractable until the assigned owner (who is too far away) teleports back to the entity.

How is this PR achieving the goal

Validate that the candidate player is in the same routing bucket and is in the culling radius of the entity.

This PR applies to the following area(s)

Server

Successfully tested on

I couldn't test this because the user that report this on the forum said that to reproduce the issue I need 20-30 players.

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

https://forum.cfx.re/t/server-side-vehicles-being-frozen-at-random/

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Nov 18, 2025
Copy link
Contributor

@FabianTerhorst FabianTerhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution.

@lLukDreams
Copy link

this would explain some of the issues people are experiencing when changing routing buckets, great work!

@FabianTerhorst FabianTerhorst added ready-to-merge This PR is enqueued for merging and removed invalid Requires changes before it's considered valid and can be (re)triaged labels Nov 18, 2025
@C4LLZ
Copy link

C4LLZ commented Nov 19, 2025

This is great work

@AvarianKnight
Copy link
Contributor

I'm a bit confused on how this actually fixes ownership (at least in the case of routing buckets), the logic is already handled via relevantTo

See:

if (clientDataUnlocked->routingBucket != entity->routingBucket)
{
if (!(entity == playerEntity))
{
isRelevant = false;
}
}

@FabianTerhorst FabianTerhorst removed the ready-to-merge This PR is enqueued for merging label Nov 19, 2025
Copy link
Contributor

@FabianTerhorst FabianTerhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After further investigation this might not be the best fix for this issue. Also entities that would be stuck in this would be fixed automatically after 10 seconds.

@DaniGP17 DaniGP17 marked this pull request as draft November 19, 2025 17:21
@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Nov 20, 2025
@DaniGP17 DaniGP17 force-pushed the fix/onesync-entity-transfer-bucket branch from 0652aa7 to 5b20ac4 Compare November 20, 2025 11:13
@DaniGP17 DaniGP17 force-pushed the fix/onesync-entity-transfer-bucket branch from 78b9020 to b2e4e51 Compare November 20, 2025 15:35
@DaniGP17 DaniGP17 marked this pull request as ready for review November 20, 2025 15:35
@github-actions github-actions bot added invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels Nov 20, 2025
@DaniGP17
Copy link
Contributor Author

I've made changes in case anyone wants to review it.

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.

5 participants