despite their names, cancel_don() and cancel_doff() both apply to both donning and doffing... */
| 1642 | /* despite their names, cancel_don() and cancel_doff() both apply to both |
| 1643 | donning and doffing... */ |
| 1644 | void |
| 1645 | cancel_doff(struct obj *obj, long slotmask) |
| 1646 | { |
| 1647 | /* Called by setworn() for old item in specified slot or by setnotworn() |
| 1648 | * for specified item. We don't want to call cancel_don() if we got |
| 1649 | * here via <X>_off() -> setworn((struct obj *) 0) -> cancel_doff() |
| 1650 | * because that would stop the 'A' command from continuing with next |
| 1651 | * selected item. So do_takeoff() sets a flag in takeoff.mask for us. |
| 1652 | * [For taking off an individual item with 'T'/'R'/'w-', it doesn't |
| 1653 | * matter whether cancel_don() gets called here--the item has already |
| 1654 | * been removed by now.] |
| 1655 | */ |
| 1656 | if (!(svc.context.takeoff.mask & I_SPECIAL) && donning(obj)) |
| 1657 | cancel_don(); /* applies to doffing too */ |
| 1658 | svc.context.takeoff.mask &= ~slotmask; |
| 1659 | } |
| 1660 | |
| 1661 | /* despite their names, cancel_don() and cancel_doff() both apply to both |
| 1662 | donning and doffing... */ |
no test coverage detected