Skip to content

Commit

Permalink
Display protection in item description
Browse files Browse the repository at this point in the history
  • Loading branch information
Fris0uman committed Jan 30, 2020
1 parent 6feb61a commit 08c0cb5
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3039,7 +3039,26 @@ void item::final_info( std::vector<iteminfo> &info, const iteminfo_query *parts,
info.push_back( iteminfo( "DESCRIPTION",
_( "<bold>Environmental Protection:</bold> " ),
iteminfo::no_newline ) );
for( const auto &element : bid->env_protec ) {
for( const std::pair< body_part, size_t > &element : bid->env_protec ) {
info.push_back( iteminfo( "CBM", body_part_name_as_heading( element.first, 1 ),
" <num> ", iteminfo::no_newline, element.second ) );
}
}

if( !bid->bash_protec.empty() ) {
info.push_back( iteminfo( "DESCRIPTION",
_( "<bold>Bash Protection:</bold> " ),
iteminfo::no_newline ) );
for( const std::pair< body_part, size_t > &element : bid->bash_protec ) {
info.push_back( iteminfo( "CBM", body_part_name_as_heading( element.first, 1 ),
" <num> ", iteminfo::no_newline, element.second ) );
}
}
if( !bid->cut_protec.empty() ) {
info.push_back( iteminfo( "DESCRIPTION",
_( "<bold>Cut Protection:</bold> " ),
iteminfo::no_newline ) );
for( const std::pair< body_part, size_t > &element : bid->cut_protec ) {
info.push_back( iteminfo( "CBM", body_part_name_as_heading( element.first, 1 ),
" <num> ", iteminfo::no_newline, element.second ) );
}
Expand Down

0 comments on commit 08c0cb5

Please sign in to comment.