MCPcopy Index your code
hub / github.com/NetHack/NetHack / display_inventory

Function display_inventory

src/invent.c:3427–3453  ·  view source on GitHub ↗

* If lets == NULL or "", list all objects in the inventory. Otherwise, * list all objects with object classes that match the order in lets. * * Returns the letter identifier of a selected item, or 0 if nothing * was selected. */

Source from the content-addressed store, hash-verified

3425 * was selected.
3426 */
3427char
3428display_inventory(const char *lets, boolean want_reply)
3429{
3430 struct _cmd_queue *cmdq = cmdq_pop();
3431
3432 if (cmdq) {
3433 if (cmdq->typ == CMDQ_KEY) {
3434 struct obj *otmp;
3435
3436 for (otmp = gi.invent; otmp; otmp = otmp->nobj)
3437 if (otmp->invlet == cmdq->key
3438 && (!lets || !*lets
3439 || strchr(lets,
3440 def_oc_syms[(int) otmp->oclass].sym))) {
3441 free(cmdq);
3442 return otmp->invlet;
3443 }
3444 }
3445
3446 /* cmdq not a key, or did not find the object, abort */
3447 free(cmdq);
3448 cmdq_clear(CQ_CANNED);
3449 return '\0';
3450 }
3451 return display_pickinv(lets, (char *) 0, (char *) 0,
3452 FALSE, want_reply, (long *) 0);
3453}
3454
3455void
3456repopulate_perminvent(void)

Callers 8

dump_everythingFunction · 0.85
discloseFunction · 0.85
ggetobjFunction · 0.85
dispinv_with_actionFunction · 0.85
sync_perminventFunction · 0.85
wiz_identifyFunction · 0.85
query_classesFunction · 0.85
do_lookFunction · 0.85

Calls 3

cmdq_popFunction · 0.85
cmdq_clearFunction · 0.85
display_pickinvFunction · 0.85

Tested by

no test coverage detected