Skip to content

Commit

Permalink
Fix aura armor morale penalties (#60411)
Browse files Browse the repository at this point in the history
* remove morale penalty when having leaves or flowers and aura armor mutation
Aura armor shouldn't cover other mutated body parts, like flowers in your head as they are part of the skin layer
fixes #60409

* Add explaining comment

Co-authored-by: nopen <nopen>
  • Loading branch information
n0pen authored Aug 26, 2022
1 parent fcf5ae1 commit c375f1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/morale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ void player_morale::set_worn( const item &it, bool worn )
const bool fancy = it.has_flag( STATIC( flag_id( "FANCY" ) ) );
const bool super_fancy = it.has_flag( STATIC( flag_id( "SUPER_FANCY" ) ) );
const bool filthy_gear = it.has_flag( STATIC( flag_id( "FILTHY" ) ) );
const bool integrated = it.has_flag( STATIC( flag_id( "INTEGRATED" ) ) );
const int sign = worn ? 1 : -1;

const auto update_body_part = [&]( body_part_data & bp_data ) {
Expand All @@ -975,7 +976,10 @@ void player_morale::set_worn( const item &it, bool worn )
if( filthy_gear ) {
bp_data.filthy += sign;
}
bp_data.covered += sign;
// If armor is integrated (Subdermal CBM, Skin armor mutation) don't count it as covering
if( !integrated ) {
bp_data.covered += sign;
}
};

const body_part_set covered( it.get_covered_body_parts() );
Expand Down

0 comments on commit c375f1d

Please sign in to comment.