Skip to content

fix(net/sbac): don't duplicate the registration of the state bag component#3292

Open
AvarianKnight wants to merge 1 commit intocitizenfx:masterfrom
AvarianKnight:tweak/client/sbac-delay-register
Open

fix(net/sbac): don't duplicate the registration of the state bag component#3292
AvarianKnight wants to merge 1 commit intocitizenfx:masterfrom
AvarianKnight:tweak/client/sbac-delay-register

Conversation

@AvarianKnight
Copy link
Contributor

Goal of this PR

RegisterStateBag gets called further down in rage::netObjectMgr::RegisterNetworkObject(obj) which is hooked to call CloneManagerLocal::RegisterNetworkObject which will then register the state bag in a queued mode where it will wait for the client to ack a packet from the server for the object before it would apply it.

Calling it here could lead to the client still getting state bag changes for this even if the entity didn't actually exist for the client.

How is this PR achieving the goal

Remove the call and rely on the call later down the call stack.

This PR applies to the following area(s)

FiveM, RedM

Successfully tested on

Game builds: ..

Platforms: Windows, Linux

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

…onent

This gets called further down in `rage::netObjectMgr::RegisterNetworkObject(obj)`
which is hooked to call `CloneManagerLocal::RegisterNetworkObject` which
will *then* register the state bag in a queued mode where it will
wait for the client to ack a packet from the server for the object
before it would apply it.

Calling it here could lead to the client still getting state bag changes
for this even if the entity didn't *actually* exist for the client.
@github-actions github-actions bot added RedM Issues/PRs related to RedM triage Needs a preliminary assessment to determine the urgency and required action labels Mar 26, 2025
@FabianTerhorst
Copy link
Contributor

@prikolium-cfx Do you think we can push this to a feature branch? I don' think we can easily test this.

@prikolium-cfx
Copy link
Collaborator

@prikolium-cfx Do you think we can push this to a feature branch? I don' think we can easily test this.

Yeah, sure.
specific/feature/state-bag-registration-delay. Will be deployed in ~1 hour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RedM Issues/PRs related to RedM triage Needs a preliminary assessment to determine the urgency and required action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants