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

Function doprwep

src/invent.c:4549–4574  ·  view source on GitHub ↗

the #seeweapon command */

Source from the content-addressed store, hash-verified

4547
4548/* the #seeweapon command */
4549int
4550doprwep(void)
4551{
4552 if (!uwep) {
4553 You("are %s.", empty_handed());
4554 } else if (!iflags.menu_requested) {
4555 prinv((char *) 0, uwep, 0L);
4556 if (u.twoweap)
4557 prinv((char *) 0, uswapwep, 0L);
4558 } else {
4559 char lets[4]; /* 4: uwep, uswapwep, uquiver, terminator */
4560 int ct = 0;
4561
4562 /* obj_to_let() will assign letters to all of invent if necessary
4563 (for '!fixinv') so doesn't need to be repeated once called here */
4564 lets[ct++] = obj_to_let(uwep);
4565 if (uswapwep)
4566 lets[ct++] = uswapwep->invlet;
4567 if (uquiver)
4568 lets[ct++] = uquiver->invlet;
4569 lets[ct] = '\0';
4570
4571 (void) dispinv_with_action(lets, TRUE, NULL);
4572 }
4573 return ECMD_OK;
4574}
4575
4576/* caller is responsible for checking !wearing_armor() */
4577staticfn void

Callers

nothing calls this directly

Calls 5

YouFunction · 0.85
empty_handedFunction · 0.85
prinvFunction · 0.85
obj_to_letFunction · 0.85
dispinv_with_actionFunction · 0.85

Tested by

no test coverage detected