Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak(core/sbag): delete state bags that get passed as nil #2717

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

AvarianKnight
Copy link
Contributor

@AvarianKnight AvarianKnight commented Aug 16, 2024

Goal of this PR

Delete state bags that have their value gets set to nil.

This will still send the value getting set to nil/null for the client so it will still hit ADD_STATE_BAG_CHANGE_HANDLER and be able to clean up previous state, but it wont be called again on scope enter/leave so it wont lead to unexpected/undesired behavior.

Getting values default to nil/null so this shouldn't break compatibility with GET_STATE_BAG_VALUE.

How is this PR achieving the goal

Check for 0xc0 and if the first byte is it, remove it from the state bag map

This PR applies to the following area(s)

Server

Successfully tested on

Game builds: b3095

Platforms: Windows

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

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Aug 16, 2024
@FabianTerhorst FabianTerhorst self-assigned this Aug 16, 2024
@FabianTerhorst FabianTerhorst removed the triage Needs a preliminary assessment to determine the urgency and required action label Aug 17, 2024
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 for the contribution. Tested and works well. 👍

@FabianTerhorst FabianTerhorst added the ready-to-merge This PR is enqueued for merging label Aug 17, 2024
@prikolium-cfx prikolium-cfx merged commit 1051d2a into citizenfx:master Aug 20, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR is enqueued for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants