Skip to content

Commit

Permalink
Merge pull request #31329 from kevingranade/avoid-refetching-heat
Browse files Browse the repository at this point in the history
Move get_heat_radiation() to avoid duplicate calls
  • Loading branch information
ZhilkinSerg authored Jun 11, 2019
2 parents 248c608 + 2430e38 commit 2e67a68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,7 @@ void player::update_bodytemp()
// Difference between high and low is the "safe" heat - one we only apply if it's beneficial
const int mutation_heat_bonus = mutation_heat_high - mutation_heat_low;

const int h_radiation = get_heat_radiation( pos(), false );
// Current temperature and converging temperature calculations
for( const body_part bp : all_body_parts ) {
// Skip eyes
Expand Down Expand Up @@ -1218,7 +1219,6 @@ void player::update_bodytemp()
// Bark : lowers blister count to -5; harder to get blisters
int blister_count = ( has_bark ? -5 : 0 ); // If the counter is high, your skin starts to burn

const int h_radiation = get_heat_radiation( pos(), false );
if( frostbite_timer[bp] > 0 ) {
frostbite_timer[bp] -= std::max( 5, h_radiation );
}
Expand Down

0 comments on commit 2e67a68

Please sign in to comment.