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

Restore original status value #13

Merged
merged 1 commit into from
May 19, 2024

Conversation

CodeCool-Developer
Copy link
Contributor

restore original value after create status from on trigger event 'esx_status:registerStatus'

restore original value  after create status from on trigger event 'esx_status:registerStatus'
@Gellipapa
Copy link
Contributor

@CodeCool-Developer Hi! Any use case?

@CodeCool-Developer
Copy link
Contributor Author

  1. To ensure that the original status is used to return the original value after esx_status:registerStatus, the original status will be used. This is because the original code was written before I made any changes. If TriggerEvent is called to esx_status:loaded, but esx_status:registerStatus is called back late, the original loop written before will not be able to return the original status value.

  2. In some cases, the status is not registered immediately after TriggerEvent('esx_status:loaded'), which causes the status to be the default value that was registered.

@CodeCool-Developer
Copy link
Contributor Author

My edit ensures that every time the status is registered, it will always receive the original status value if it exists in the OriginalStatus variable.

@Gellipapa
Copy link
Contributor

Hi! @CodeCool-Developer Thanks for this implementation, merged.

@Gellipapa Gellipapa merged commit 2e8f3cf into esx-framework:main May 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants