-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 for freezing bugs - part 2 #24905
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0911c31
fix freezing bugs part 2
nexusmrsep d3e0598
mushy flag fixes
nexusmrsep c92b8c6
std::min and max for clarity
nexusmrsep 543f128
astyle
nexusmrsep e0a87f9
rewording sentence
nexusmrsep e55e34d
fix for non-food comestibles becoming (active) on spawn
nexusmrsep c7860af
unsigned integer
nexusmrsep 2575ccd
unsigned integer - reversed approach
nexusmrsep File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 > 10 ? 10 : diff_freeze; | ||
diff_freeze = std::max( 1, diff_freeze ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just noticed that in a compiler, sorry |
||
diff_freeze = std::min( 5, diff_freeze ); | ||
|
||
unsigned int diff_cold = abs(temp - FRIDGE_TEMPERATURE); | ||
diff_cold = diff_cold < 1 ? 1 : diff_cold; | ||
diff_cold = diff_cold > 10 ? 10 : diff_cold; | ||
diff_freeze = std::max( 1, diff_cold ); | ||
diff_freeze = std::min( 5, diff_cold ); | ||
|
||
if( it.is_food() ) { | ||
if( temp <= FREEZING_TEMPERATURE ) { | ||
|
@@ -4604,8 +4604,8 @@ void map::apply_in_fridge( item &it, int temp ) | |
it.item_counter = 0; | ||
} | ||
// This sets the COLD flag, and doesn't go above 600 | ||
if( it.has_flag( "EATEN_COLD" ) && !( it.item_tags.count( "COLD" ) || | ||
it.item_tags.count( "FROZEN" ) || it.item_tags.count( "HOT" ) ) ) { | ||
if( !( it.item_tags.count( "COLD" ) || it.item_tags.count( "FROZEN" ) || | ||
it.item_tags.count( "HOT" ) ) ) { | ||
|
||
it.item_tags.insert( "COLD" ); | ||
it.active = true; | ||
|
@@ -4614,16 +4614,15 @@ void map::apply_in_fridge( item &it, int temp ) | |
it.item_counter += diff_cold; | ||
} | ||
// Freezer converts COLD flag at 600 ticks to FROZEN flag with max 600 ticks | ||
if ( temp <= FREEZING_TEMPERATURE && it.item_tags.count( "COLD" ) && it.item_counter >= 600 ) { | ||
if ( temp <= FREEZING_TEMPERATURE && it.item_tags.count( "COLD" ) && it.item_counter >= 600 && | ||
!( it.item_tags.count( "FROZEN" ) || it.item_tags.count( "HOT" ) ) ) { | ||
|
||
it.item_tags.erase( "COLD" ); | ||
it.item_tags.insert( "FROZEN" ); | ||
it.active = true; | ||
it.item_counter = 0; | ||
} | ||
// items that don't use COLD flag can go FROZEN bypassing COLD state | ||
if( !it.has_flag( "EATEN_COLD" ) && !it.item_tags.count( "FROZEN" ) ) { | ||
it.item_tags.insert( "FROZEN" ); | ||
it.active = true; | ||
|
||
// items that don't use COLD flag can go FROZEN bypassing COLD state | ||
} | ||
if ( temp <= FREEZING_TEMPERATURE && it.item_tags.count( "FROZEN" ) && it.item_counter <= 600 ) { | ||
it.item_counter += diff_freeze; | ||
|
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.
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 is still an error. Here's a suggestion:
(...), and it will become mushy after thawing out.