Skip to content

Commit

Permalink
More cleanup after is_craft() change
Browse files Browse the repository at this point in the history
  • Loading branch information
ifreund committed Apr 3, 2019
1 parent 46d3a66 commit 628f432
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ std::string item::info( std::vector<iteminfo> &info, const iteminfo_query *parts
} else if( idescription != item_vars.end() ) {
info.push_back( iteminfo( "DESCRIPTION", idescription->second ) );
} else {
if( is_craft() && making ) {
if( is_craft() ) {
const std::string desc = _( "This is an in progress %s. It is %d percent complete." );
const int percent_progress = 100 * item_counter / making->time;
info.push_back( iteminfo( "DESCRIPTION", string_format( desc,
Expand Down Expand Up @@ -2993,18 +2993,12 @@ std::string item::tname( unsigned int quantity, bool with_prefix ) const
} else if( is_craft() ) {
ret.str( "" );
const std::string name = _( "in progress %s" );
if( making ) {
ret << string_format( name, making->result_name() );
} else {
ret << string_format( name, item().tname() );
}
ret << string_format( name, making->result_name() );
if( charges > 1 ) {
ret << " (" << charges << ")";
}
if( making ) {
const int percent_progress = 100 * item_counter / making->time;
ret << " (" << percent_progress << "%)";
}
const int percent_progress = 100 * item_counter / making->time;
ret << " (" << percent_progress << "%)";
maintext = ret.str();
} else if( contents.size() == 1 ) {
const item &contents_item = contents.front();
Expand Down

0 comments on commit 628f432

Please sign in to comment.