Skip to content

Commit

Permalink
Merge pull request CleverRaven#38020 from Fris0uman/exo_clean
Browse files Browse the repository at this point in the history
Clean some exothermic CBM code
  • Loading branch information
Rivet-the-Zombie authored Feb 19, 2020
2 parents 9286722 + abd9b7d commit 1d23fcc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,12 +1096,14 @@ void Character::heat_emission( int b, int fuel_energy )
}
const float efficiency = bio.info().fuel_efficiency;

const int &heat_prod = fuel_energy * ( 1 - efficiency );
const int &heat_level = std::min( heat_prod / 10, 4 );
const int &heat_spread = std::max( heat_prod / 10 - heat_level, 1 );
const int heat_prod = fuel_energy * ( 1.0f - efficiency );
const int heat_level = std::min( heat_prod / 10, 4 );
const emit_id hotness = emit_id( "emit_hot_air" + to_string( heat_level ) + "_cbm" );
g->m.emit_field( pos(), hotness, heat_spread );
for( const auto bp : bio.info().occupied_bodyparts ) {
if( hotness.is_valid() ) {
const int heat_spread = std::max( heat_prod / 10 - heat_level, 1 );
g->m.emit_field( pos(), hotness, heat_spread );
}
for( const std::pair<body_part, size_t> &bp : bio.info().occupied_bodyparts ) {
add_effect( effect_heating_bionic, 2_seconds, bp.first, false, heat_prod );
}
}
Expand Down

0 comments on commit 1d23fcc

Please sign in to comment.