Skip to content

Commit 913723a

Browse files
committed
Show charges for unidentified ammunition. Fix calref#718
1 parent 8b20563 commit 913723a

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/game/boe.text.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,25 @@ void put_item_screen(eItemWinMode screen_num) {
326326
} else style.colour = Colours::BLACK;
327327

328328
sout.str("");
329-
if(!item.ident)
330-
sout << item.name << " ";
331-
else { /// Don't place # of charges when Sell button up and space tight
329+
330+
if(item.ident)
332331
sout << item.full_name << ' ';
333-
if(item.charges > 0 && item.ability != eItemAbil::MESSAGE && (stat_screen_mode == MODE_INVEN || stat_screen_mode == MODE_SHOP))
334-
sout << '(' << int(item.charges) << ')';
332+
else
333+
sout << item.name << " ";
334+
335+
// Charges:
336+
bool show_charges = item.max_charges > 0;
337+
// Show charges for unidentified ammunition, but not other items
338+
if(item.missile <= 0)
339+
show_charges &= item.ident;
340+
// Don't show charges if it just shows a dialog
341+
show_charges &= item.ability != eItemAbil::MESSAGE;
342+
// Don't show charges when Sell button up and space tight
343+
show_charges &= (stat_screen_mode == MODE_INVEN || stat_screen_mode == MODE_SHOP);
344+
if(show_charges){
345+
sout << '(' << int(item.charges) << ')';
335346
}
347+
336348
dest_rect.left -= 2;
337349
win_draw_string(item_stats_gworld(),dest_rect,sout.str(),eTextMode::WRAP,style);
338350
style.italic = false;

0 commit comments

Comments
 (0)