the #seetools command */
| 4712 | |
| 4713 | /* the #seetools command */ |
| 4714 | int |
| 4715 | doprtool(void) |
| 4716 | { |
| 4717 | struct obj *otmp; |
| 4718 | int ct = 0; |
| 4719 | char lets[invlet_basic + 1]; |
| 4720 | |
| 4721 | for (otmp = gi.invent; otmp; otmp = otmp->nobj) |
| 4722 | if (tool_being_used(otmp)) { |
| 4723 | /* we could be carrying more than 52 items; theoretically they |
| 4724 | might all be lit candles so avoid potential lets[] overflow */ |
| 4725 | if (ct >= (int) sizeof lets - 1) |
| 4726 | break; |
| 4727 | lets[ct++] = obj_to_let(otmp); |
| 4728 | } |
| 4729 | lets[ct] = '\0'; |
| 4730 | if (!ct) |
| 4731 | You("are not using any tools."); |
| 4732 | else |
| 4733 | (void) dispinv_with_action(lets, TRUE, NULL); |
| 4734 | return ECMD_OK; |
| 4735 | } |
| 4736 | |
| 4737 | /* the #seeall command; combines the ')' + '[' + '=' + '"' + '(' commands; |
| 4738 | show inventory of all currently wielded, worn, or used objects */ |
nothing calls this directly
no test coverage detected