fix #6284 - empty perm_invent

Report was for tty, but X11 exhibited the same behavior.  With the
perm_invent option enabled, when the permanent inventory window is
displayed, it would be empty if not carrying anything.  For tty, that
meant a naked "(end) " selection prompt.  Put a separator line of "Not
carrying anything" into the menu so that it won't be completely empty.
The selection prompt is still present but it is attached to something.
(The behavior is different from !perm_invent, where you get that same
text via pline without any menu at all.)
This commit is contained in:
PatR
2017-10-28 14:12:50 -07:00
parent bba7a6b44c
commit 72978d69fa
3 changed files with 23 additions and 7 deletions

View File

@@ -1274,8 +1274,11 @@ int how;
if (have_windows) {
wait_synch();
free_pickinv_cache(); /* extra persistent window if perm_invent */
if (WIN_INVEN != WIN_ERR)
if (WIN_INVEN != WIN_ERR) {
destroy_nhwindow(WIN_INVEN), WIN_INVEN = WIN_ERR;
/* precaution in case any late update_inventory() calls occur */
flags.perm_invent = 0;
}
display_nhwindow(WIN_MESSAGE, TRUE);
destroy_nhwindow(WIN_MAP), WIN_MAP = WIN_ERR;
#ifndef STATUS_HILITES
@@ -1315,7 +1318,7 @@ int how;
? (const char *) ((flags.female && urole.name.f)
? urole.name.f
: urole.name.m)
: (const char *) (flags.female ? "Demigoddess" : "Demigod"));
: (const char *) (flags.female ? "Demigoddess" : "Demigod"));
dump_forward_putstr(endwin, 0, pbuf, done_stopprint);
dump_forward_putstr(endwin, 0, "", done_stopprint);
@@ -1350,6 +1353,7 @@ int how;
Schroedingers_cat = odds_and_ends(invent, CAT_CHECK);
if (Schroedingers_cat) {
int mhp, m_lev = adj_lev(&mons[PM_HOUSECAT]);
mhp = d(m_lev, 8);
nowrap_add(u.urexp, mhp);
Strcat(eos(pbuf), " and Schroedinger's cat");