Skip to content

Commit

Permalink
Food continues to rot at temp above 63C
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed May 24, 2024
1 parent de4ec39 commit dc5d623
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7950,10 +7950,8 @@ float item::calc_hourly_rotpoints_at_temp( const units::temperature &temp ) cons
{
const units::temperature dropoff = units::from_fahrenheit( 38 ); // F, ~3 C
const float max_rot_temp = 105; // F, ~41 C, Maximum rotting rate is at this temperature
const float safe_temp = 145; // F, ~63 C, safe temperature above which food stops rotting

if( temp <= temperatures::freezing ||
temp > units::from_fahrenheit( safe_temp ) ) {
if( temp <= temperatures::freezing ) {
return 0.f;
} else if( temp < dropoff ) {
// ditch our fancy equation and do a linear approach to 0 rot from 38 F (3 C) -> 32 F (0 C)
Expand All @@ -7963,7 +7961,7 @@ float item::calc_hourly_rotpoints_at_temp( const units::temperature &temp ) cons
// Exponential progress from 38 F (3 C) to 105 F (41 C)
return 3600.f * std::exp2( ( units::to_fahrenheit( temp ) - 65.f ) / 16.f );
} else {
// Constant rot from 105 F (41 C) to 145 F (63 C)
// Constant rot from 105 F (41 C) upwards
// This is approximately 20364.67 rot/hour
return 3600.f * std::exp2( ( max_rot_temp - 65.f ) / 16.f );
}
Expand Down

0 comments on commit dc5d623

Please sign in to comment.