Align fatigue level comparisons for UI and effects #59055
Merged
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.
Summary
Bugfixes "Fixed Tired status showing up with delay after fatigue penalties start"
Purpose of change
The effect of fatigue on focus starts on greater-or-equal to threshold, while UI uses greater, so the effects start 1 focus point before "Tired" pops up. Same for further transitions. This can be confusing if you notice your focus tanking, stop to investigate, but the reason isn't visible until a while later.
Describe the solution
Change
>
to>=
and<=
to<
.Describe alternatives you've considered
Change it the other way around.
It bothers me a little that the logic is duplicated in sidebar and in the hardcoded function but I'll leave it to the sidebar enthusiasts to worry about.
Testing
Debugged a character to 190 fatigue (1 point before the exact threshold between not tired and Tired)
Before: focus cap starts after 5 minutes, "Tired" doesn't appear on sidebar and medical menu until 5 more minutes
After: focus cap and "Tired" labels appear at the same time
Also tried the other thresholds (383, 575)
Additional context