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 shivering mechanism #60991

Closed

Conversation

peter4370
Copy link
Contributor

@peter4370 peter4370 commented Sep 14, 2022

Summary

Bugfixes "Fix shivering mechanism"

Purpose of change

Fix #47671
Fix #53443
While being cold could prevent you from sleep in real life, It is unclear if the warmth in @ window is enough to prevent shivering and leads to confusion.
Also you can fall asleep while being too cold if you are tired enough in real life.

Describe the solution

Lowering the threshold to let player could sleep in spring.
Also make player able to sleep if they are deadly tire to prevent extreme sleep deprivation.

Describe alternatives you've considered

Make body temperature more accurate. (see #58961)
Remove this mechanism as we have another being too cold wakes you up mechanism at player_hardcoded_effects.cpp

Testing

Test 1:
Create a character spawn in spring
Being naked
Set fatigue to tired
Being able to sleep without waking up
Test 2:
The same as above but in winter
Wake up due to cold after falling asleep
Test 3:
The same as test 2 but being exhausted
Ignore warnings and keep trying to sleep
Wake up from cold because the code in player_hardcoded_effects.cpp
Try sleep again and die because of too cold

Additional context

Some comments in update_bodytemp.cpp are incorrect. I updated them in this PR too.
I don't see #53411 happening so if someone checked it doesn't happen anymore that issue could be closed.

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Sep 14, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 14, 2022
@NetSysFire NetSysFire added Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics Mechanics: Character / Player Character / Player mechanics labels Sep 14, 2022
@peter4370 peter4370 requested a review from Fris0uman September 17, 2022 02:46
@Fris0uman
Copy link
Contributor

Maybe make it so you still get a message about shivering with the same condition as before but it only wakes you up if it's really cold (and you're not dead tired)?

@peter4370
Copy link
Contributor Author

I'm busy recently and don't want to work on this PR. If anyone want to fix the issue I would happy to see that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions Mechanics: Character / Player Character / Player mechanics Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shivering mechanics are inconsistent Shivering Mechanics
5 participants