* 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. */
| 3425 | * was selected. |
| 3426 | */ |
| 3427 | char |
| 3428 | display_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 | |
| 3455 | void |
| 3456 | repopulate_perminvent(void) |
no test coverage detected