Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upFix for freezing bugs - part 2 #24905
Conversation
nexusmrsep
added some commits
Aug 17, 2018
This comment has been minimized.
This comment has been minimized.
stk2008
commented
Aug 17, 2018
|
Yes thank you cant wait for merge :0 |
Night-Pryanik
reviewed
Aug 17, 2018
| @@ -4580,11 +4580,11 @@ void map::apply_in_fridge( item &it, int temp ) | |||
| { | |||
| unsigned int diff_freeze = abs(temp - FREEZING_TEMPERATURE); | |||
| diff_freeze = diff_freeze < 1 ? 1 : diff_freeze; | |||
| diff_freeze = diff_freeze > 10 ? 10 : diff_freeze; | |||
| diff_freeze = diff_freeze > 5 ? 5 : diff_freeze; | |||
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
Aug 17, 2018
Member
You can use std::min( 5, diff_freeze ) for this and std::max( 1, diff_freeze ) above. The same for diff_cold below.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
Aug 17, 2018
Member
Honestly, I don't know. For me it's just more clear and readable. Need consulting from more competent guys.
This comment has been minimized.
This comment has been minimized.
ZhilkinSerg
Aug 17, 2018
Contributor
would it be better performance wise?
It won't be more slow, but much more readable.
nexusmrsep
added
Translation
Food / Vitamins
<Bugfix>
labels
Aug 17, 2018
nexusmrsep
added some commits
Aug 17, 2018
Xhuis
reviewed
Aug 17, 2018
| if( food_item->has_flag( "NO_FREEZE" ) && !food_item->rotten() ) { | ||
| info.emplace_back( "DESCRIPTION", _( "* Quality of this food suffers when it's <neutral>frozen.</neutral>." ) ); | ||
| if( food_item->has_flag( "NO_FREEZE" ) && !food_item->rotten() && !food_item->has_flag( "MUSHY" ) ) { | ||
| info.emplace_back( "DESCRIPTION", _( "* Quality of this food suffers when it's <neutral>frozen, and it becames mushy after defrosting</neutral>." ) ); |
This comment has been minimized.
This comment has been minimized.
Xhuis
Aug 17, 2018
Contributor
This is still an error. Here's a suggestion:
(...), and it will become mushy after thawing out.
nexusmrsep
added some commits
Aug 17, 2018
ZhilkinSerg
reviewed
Aug 17, 2018
| @@ -4579,12 +4579,12 @@ void map::make_active( item_location &loc ) | |||
| void map::apply_in_fridge( item &it, int temp ) | |||
| { | |||
| unsigned int diff_freeze = abs(temp - FREEZING_TEMPERATURE); | |||
| diff_freeze = diff_freeze < 1 ? 1 : diff_freeze; | |||
| diff_freeze = diff_freeze > 5 ? 5 : diff_freeze; | |||
| diff_freeze = std::max( 1, diff_freeze ); | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ZhilkinSerg
merged commit b8ef478
into
CleverRaven:master
Aug 17, 2018
nexusmrsep
deleted the
nexusmrsep:temp_fix_no_2
branch
Aug 18, 2018
Brambor
reviewed
Aug 19, 2018
| diff_cold = diff_cold < 1 ? 1 : diff_cold; | ||
| diff_cold = diff_cold > 10 ? 10 : diff_cold; | ||
| diff_freeze = std::max( static_cast<unsigned int>(1), diff_cold ); | ||
| diff_freeze = std::min( static_cast<unsigned int>(5), diff_cold ); |
This comment has been minimized.
This comment has been minimized.
Brambor
Aug 19, 2018
Contributor
Sorry for bothering. These two lines seems wierd as the above one keeps diff_cold and those two change to diff_freeze. I'm writing this just so that it can be double-checked.
This comment has been minimized.
This comment has been minimized.
nexusmrsep
Aug 19, 2018
Author
Contributor
You are right and fix is included in PR #24971 waiting to be merged.

nexusmrsep commentedAug 17, 2018
•
edited
Resolves #24875 (this was solved only partially)
Resolves #24893
Resolves #24898
This patch solves few problems:
There might be more tweaks in this topic, but removing bugs gets priority over that.