Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes encumbrance_covered muts being covered by integrated armor #63182

Merged
merged 3 commits into from
Jan 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3657,18 +3657,13 @@ void Character::apply_mut_encumbrance( std::map<bodypart_id, encumbrance_data> &
// Lower penalty for bps covered only by XL armor
// Initialized on demand for performance reasons:
// (calculation is costly, most of players and npcs are don't have encumbering mutations)
cata::optional<body_part_set> oversize;

for( const trait_id &mut : all_muts ) {
for( const std::pair<const bodypart_str_id, int> &enc : mut->encumbrance_always ) {
total_enc[enc.first] += enc.second;
}
for( const std::pair<const bodypart_str_id, int> &enc : mut->encumbrance_covered ) {
if( !oversize ) {
// initialize on demand
oversize = exclusive_flag_coverage( flag_OVERSIZE );
}
if( !oversize->test( enc.first ) ) {
if( wearing_fitting_on( enc.first ) ) {
total_enc[enc.first] += enc.second;
}
}
Expand Down