Skip to content

Commit

Permalink
fix: make annual average namespaced
Browse files Browse the repository at this point in the history
see: cataclysmbnteam#2570 (comment)

Co-authored-by: olanti-p <[email protected]>
  • Loading branch information
scarf005 and olanti-p committed Sep 18, 2023
1 parent 9d32eb6 commit 1541165
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/game_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ static constexpr int VEHICLE_HANDLING_PENALTY = 80;
static constexpr int PLUTONIUM_CHARGES = 500;

// Temperature constants.
namespace temperatures
{

/// Average annual temperature used for climate, weather and temperature calculation.
constexpr units::temperature average_annual_termperature = 6_c;
constexpr units::temperature annual_average = 6_c;

namespace temperatures
{
// temperature at which something starts is considered HOT.
constexpr units::temperature hot = 38_c;

Expand All @@ -101,7 +101,7 @@ constexpr units::temperature freezer = -5_c;
constexpr units::temperature freezing = 0_c;

// Arbitrary constant for root cellar temperature
constexpr units::temperature root_cellar = average_annual_termperature;
constexpr units::temperature root_cellar = annual_average;
} // namespace temperatures

// Weight per level of LIFT/JACK tool quality.
Expand Down
2 changes: 1 addition & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9023,7 +9023,7 @@ bool item::process_rot( const bool seals, const tripoint &pos,
calendar::config, seed );
env_temperature_raw = weather_temperature + local_mod;
} else {
env_temperature_raw = average_annual_termperature + local_mod;
env_temperature_raw = temperatures::annual_average + local_mod;
}

units::temperature env_temperature_clipped = clip_by_temperature_flag( env_temperature_raw, flag );
Expand Down
4 changes: 2 additions & 2 deletions src/weather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ int weather_manager::get_temperature( const tripoint &location ) const
temp_mod += get_convection_temperature( location );
}
//underground temperature = average New England temperature = 43F/6C rounded to int
const int temp = ( location.z < 0 ? units::to_fahrenheit( average_annual_termperature ) :
const int temp = ( location.z < 0 ? units::to_fahrenheit( temperatures::annual_average ) :
temperature ) +
( g->new_game ? 0 : g->m.get_temperature( location ) + temp_mod );

Expand All @@ -1133,7 +1133,7 @@ int weather_manager::get_temperature( const tripoint &location ) const
int weather_manager::get_temperature( const tripoint_abs_omt &location )
{
if( location.z() < 0 ) {
return units::to_fahrenheit( average_annual_termperature );
return units::to_fahrenheit( temperatures::annual_average );
}

tripoint abs_ms = project_to<coords::ms>( location ).raw();
Expand Down

0 comments on commit 1541165

Please sign in to comment.