MCPcopy Create free account
hub / github.com/NetHack/NetHack / doprinuse

Function doprinuse

src/invent.c:4739–4757  ·  view source on GitHub ↗

the #seeall command; combines the ')' + '[' + '=' + '"' + '(' commands; show inventory of all currently wielded, worn, or used objects */

Source from the content-addressed store, hash-verified

4737/* the #seeall command; combines the ')' + '[' + '=' + '"' + '(' commands;
4738 show inventory of all currently wielded, worn, or used objects */
4739int
4740doprinuse(void)
4741{
4742 struct obj *otmp;
4743 int ct = 0;
4744
4745 /* no longer need to collect letters; sortloot() takes care of it, but
4746 still want to count far enough to know whether anything is in use */
4747 for (otmp = gi.invent; otmp; otmp = otmp->nobj)
4748 if (is_inuse(otmp)) {
4749 ++ct;
4750 break;
4751 }
4752 if (!ct)
4753 You("are not wearing or wielding anything.");
4754 else
4755 (void) dispinv_with_action((char *) 0, TRUE, NULL);
4756 return ECMD_OK;
4757}
4758
4759/*
4760 * uses up an object that's on the floor, charging for it as necessary

Callers

nothing calls this directly

Calls 3

is_inuseFunction · 0.85
YouFunction · 0.85
dispinv_with_actionFunction · 0.85

Tested by

no test coverage detected