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

Function doremring

src/do_wear.c:1873–1889  ·  view source on GitHub ↗

the #remove command - take off ring or other accessory */

Source from the content-addressed store, hash-verified

1871
1872/* the #remove command - take off ring or other accessory */
1873int
1874doremring(void)
1875{
1876 struct obj *otmp = 0;
1877
1878 count_worn_stuff(&otmp, TRUE);
1879 if (!Naccessories && !Narmorpieces) {
1880 pline("Not wearing any accessories or armor.");
1881 return ECMD_OK;
1882 }
1883 if (Naccessories != 1 || ParanoidRemove || cmdq_peek(CQ_CANNED))
1884 otmp = getobj("remove", remove_ok, GETOBJ_NOFLAGS);
1885 if (!otmp)
1886 return ECMD_CANCEL;
1887
1888 return armor_or_accessory_off(otmp);
1889}
1890
1891/* Check if something worn is cursed _and_ unremovable. */
1892int

Callers

nothing calls this directly

Calls 5

count_worn_stuffFunction · 0.85
cmdq_peekFunction · 0.85
getobjFunction · 0.85
armor_or_accessory_offFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected