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

fix(client/laststand): counting down at double speed #102

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

Manason
Copy link
Member

@Manason Manason commented Oct 30, 2024

StartLastStand() is invoked when the player takes damage, however waits for the player to stop moving to actually change the state bag value. Thus if the player takes further damage while rag dolling, StartLastStand() is triggered again. This results in multiple threads being created which count down the counter.

The solution in this PR is to acquire an exclusive lock so that StartLastStand() cannot be running in two separate threads.
An alternative solution would be to move the waiting for the player to stop moving to the call sites of StartLastStand() and instead of using a lock, just check the state bag value isn't already in last stand.

@Manason Manason merged commit 3b79725 into main Oct 31, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants