Skip to content

Commit

Permalink
old-style cast fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Robik81 committed Oct 16, 2020
1 parent 2b0322c commit 2bedee1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1976,11 +1976,11 @@ void Character::update_body_wetness( const w_point &weather )
double clothing_mult = 1.0;
for( const item &i : worn ) {
if( i.covers( bp ) ) {
const double item_coverage = ( double )i.get_coverage( bp ) / 100;
const double item_breathability = ( double )i.breathability() / 100;
const double item_coverage = static_cast<double>( i.get_coverage( bp ) ) / 100;
const double item_breathability = static_cast<double>( i.breathability() ) / 100;

// breathability of naked skin + breathability of item
const double breathability = ( 1 - item_coverage ) + item_coverage * item_breathability;
const double breathability = ( 1.0 - item_coverage ) + item_coverage * item_breathability;

clothing_mult += 1.0 - breathability;
}
Expand All @@ -1990,13 +1990,14 @@ void Character::update_body_wetness( const w_point &weather )
const double turns_to_dry = to_turns<double>( drying );

const int drench_cap = get_part_drench_capacity( bp );
const double dry_per_turn = ( double )drench_cap / turns_to_dry;
const double dry_per_turn = static_cast<double>( drench_cap ) / turns_to_dry;
mod_part_wetness( bp, roll_remainder( dry_per_turn ) * -1 );

// Make evaporation reduce body heat
if( !( bp->has_flag( "IGNORE_TEMP" ) ) ) {
const int temp_cur = get_part_temp_cur( bp );
mod_part_temp_cur( bp, roll_remainder( ( double )temp_cur / clothing_mult / 2000 ) * -1 );
mod_part_temp_cur( bp, roll_remainder( static_cast<double>( temp_cur ) / clothing_mult / 2000 ) *
-1 );
}

// Safety measure to keep wetness within bounds
Expand Down

0 comments on commit 2bedee1

Please sign in to comment.