Skip to content

Commit

Permalink
a more civilized approach
Browse files Browse the repository at this point in the history
  • Loading branch information
moxian committed Dec 9, 2024
1 parent b8fee8e commit 559e03c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2495,17 +2495,19 @@ void item::basic_info( std::vector<iteminfo> &info, const iteminfo_query *parts,
info.emplace_back( "DESCRIPTION", type->description.translated() );
}
}
insert_separation_line( info );
}

if( parts->test( iteminfo_parts::DESCRIPTION_VARIANT_BASETYPE ) ) {
if( has_itype_variant() ) {
const std::string typ_name = type->get_id().str();
const std::string var_name = itype_variant().id;
if( var_name != "" && typ_name != var_name ) {

Check failure on line 2505 in src/item.cpp

View workflow job for this annotation

GitHub Actions / build (src)

the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty,-warnings-as-errors]
insert_separation_line( info );
info.emplace_back( "DESCRIPTION", string_format( _( "It is a kind of a %s." ), type->nname( 1 ) ) );
}
insert_separation_line( info );
}

insert_separation_line( info );
}

insert_separation_line( info );
Expand Down
1 change: 1 addition & 0 deletions src/iteminfo_query.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ enum class iteminfo_parts : size_t {
ACTIONS,

DESCRIPTION,
DESCRIPTION_VARIANT_BASETYPE,
DESCRIPTION_TECHNIQUES,
DESCRIPTION_GUNMOD_ADDREACHATTACK,
DESCRIPTION_MELEEDMG,
Expand Down

0 comments on commit 559e03c

Please sign in to comment.