-
Notifications
You must be signed in to change notification settings - Fork 139
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
Feature/reset food saturation #903
base: master
Are you sure you want to change the base?
Conversation
race condition plz add mutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix race conditions
@@ -65,6 +65,14 @@ func (m *hungerManager) Reset() { | |||
m.mu.Unlock() | |||
} | |||
|
|||
// ResetExhaustion resets the exhaustion level of the player to 0. | |||
// Prevents the player food level decrease after non cancelling the food loss | |||
func (m *hungerManager) resetExhaustion() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function cause race condition plz fix
Co-authored-by: CJ <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz
Co-authored-by: jack <[email protected]>
Co-authored-by: jack <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Should it reset it to 0 or what it was before the last event was cancelled? |
Add reset the exhaustion and saturation when the Food Loss handler is cancelled. This help to prevent loss very fast the food after no longer cancelling that handler.
Example
2024-07-22.17-40-15.mp4