diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 3002f5512..c36858045 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -466,6 +466,7 @@ sometimes rings dropped into sinks can be found in the pipes doors in special levels were always generated in vertical orientation assigning a type name to a potion on the floor which is actually a mimic could prompt "Call a stream of fluid:" (bogus 'fromsink') +with perm_invent option enabled and no inventory, 'i' put up an empty menu Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository diff --git a/src/end.c b/src/end.c index d0fb09bc5..e1d8a6423 100644 --- a/src/end.c +++ b/src/end.c @@ -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"); diff --git a/src/invent.c b/src/invent.c index 429b5a9d5..edacfc547 100644 --- a/src/invent.c +++ b/src/invent.c @@ -2180,6 +2180,7 @@ const char *query; boolean want_reply; long *out_cnt; { + static const char not_carrying_anything[] = "Not carrying anything"; struct obj *otmp; char ilet, ret; char *invlet = flags.inv_order; @@ -2226,7 +2227,7 @@ long *out_cnt; ++n; if (n == 0) { - pline("Not carrying anything."); + pline("%s.", not_carrying_anything); return 0; } @@ -2314,14 +2315,24 @@ nextclass: goto nextclass; } } - if (iflags.force_invmenu && lets && want_reply) { any = zeroany; - add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Special", MENU_UNSELECTED); + add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, + "Special", MENU_UNSELECTED); any.a_char = '*'; - add_menu(win, NO_GLYPH, &any, '*', 0, ATR_NONE, "(list everything)", MENU_UNSELECTED); + add_menu(win, NO_GLYPH, &any, '*', 0, ATR_NONE, + "(list everything)", MENU_UNSELECTED); + } + /* for permanent inventory where we intend to show everything but + nothing has been listed (because there isn't anyhing to list; + recognized via any.a_char still being zero; the n==0 case above + gets skipped for perm_invent), put something into the menu */ + if (flags.perm_invent && !lets && !any.a_char) { + any = zeroany; + add_menu(win, NO_GLYPH, &any, 0, 0, 0, + not_carrying_anything, MENU_UNSELECTED); + want_reply = FALSE; } - end_menu(win, query && *query ? query : (char *) 0); n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected);