-/* NetHack 3.7 invent.c $NHDT-Date: 1608846067 2020/12/24 21:41:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.310 $ */
+/* NetHack 3.7 invent.c $NHDT-Date: 1612738685 2021/02/07 22:58:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.318 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
/*
* Internal function used by display_inventory and getobj that can display
- * inventory and return a count as well as a letter. If out_cnt is not null,
- * any count returned from the menu selection is placed here.
+ * inventory and return a count as well as a letter.
*/
static char
-display_pickinv(register const char *lets,
- const char *xtra_choice, /* "fingers", pick hands rather than
- an object */
- const char *query, boolean want_reply, long *out_cnt)
+display_pickinv(
+ const char *lets, /* non-compacted list of invlet values */
+ const char *xtra_choice, /* non-object "bare hands" or "fingers" */
+ const char *query, /* optional; prompt string for menu */
+ boolean want_reply, /* True: select an item, False: just display */
+ long *out_cnt) /* optional; count player entered when selecting an item */
{
static const char not_carrying_anything[] = "Not carrying anything";
struct obj *otmp, wizid_fakeobj;
/* for xtra_choice, there's another 'item' not included in initial 'n';
for !lets (full g.invent) and for override_ID (wizard mode identify),
skip message_menu handling of single item even if item count was 1 */
- if (xtra_choice || (n == 1 && (!lets || iflags.override_ID)))
+ if (xtra_choice || (n == 1 && (!lets || wizid)))
++n;
if (n == 0) {
start_menu(win, MENU_BEHAVE_STANDARD);
any = cg.zeroany;
- if (wizard && iflags.override_ID) {
+ if (wizid) {
int unid_cnt;
char prompt[QBUFSZ];
xtra_choice, MENU_ITEMFLAGS_NONE);
gotsomething = TRUE;
}
+
nextclass:
classcount = 0;
for (srtinv = sortedinvent; (otmp = srtinv->obj) != 0; ++srtinv) {
not_carrying_anything, MENU_ITEMFLAGS_NONE);
want_reply = FALSE;
}
- end_menu(win, query && *query ? query : (char *) 0);
+ end_menu(win, (query && *query) ? query : (char *) 0);
n = select_menu(win,
wizid ? PICK_ANY : want_reply ? PICK_ONE : PICK_NONE,