fix(net/sbac): don't duplicate the registration of the state bag component #3292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal of this PR
RegisterStateBag
gets called further down inrage::netObjectMgr::RegisterNetworkObject(obj)
which is hooked to callCloneManagerLocal::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
Fixes issues