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

Function cancel_don

src/do_wear.c:1663–1684  ·  view source on GitHub ↗

despite their names, cancel_don() and cancel_doff() both apply to both donning and doffing... */

Source from the content-addressed store, hash-verified

1661/* despite their names, cancel_don() and cancel_doff() both apply to both
1662 donning and doffing... */
1663void
1664cancel_don(void)
1665{
1666 /* the piece of armor we were donning/doffing has vanished, so stop
1667 * wasting time on it (and don't dereference it when donning would
1668 * otherwise finish); afternmv never has some of these values because
1669 * every item of the corresponding armor category takes 1 turn to wear,
1670 * but check all of them anyway
1671 */
1672 svc.context.takeoff.cancelled_don = (ga.afternmv == Cloak_on
1673 || ga.afternmv == Armor_on
1674 || ga.afternmv == Shirt_on
1675 || ga.afternmv == Helmet_on
1676 || ga.afternmv == Gloves_on
1677 || ga.afternmv == Boots_on
1678 || ga.afternmv == Shield_on);
1679 ga.afternmv = (int (*)(void)) 0;
1680 gn.nomovemsg = (char *) 0;
1681 gm.multi = 0;
1682 svc.context.takeoff.delay = 0;
1683 svc.context.takeoff.what = 0L;
1684}
1685
1686/* called by steal() during theft from hero; interrupt donning/doffing */
1687int

Callers 5

remove_worn_itemFunction · 0.85
cancel_doffFunction · 0.85
stop_donningFunction · 0.85
wornarm_destroyedFunction · 0.85
break_armorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected