'A' again - avoid stale takeoff.mask
The do_wear.c part just eliminates some redundant code but shouldn't produce any change in behavior. The steal.c part should fix problems with 'A' when outer items are taken off during theft in order to steal an inner item, where the outer item is next to be removed (call to cancel_don() wasn't being made). The wield.c part matches the X_off() behavior and is needed to handle a weapon item that's slated for removal but isn't next (so wouldn't pass the donning()/doffing() test to trigger cancel_don()). If this seems a lot like trial and error, it is....
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 wield.c $NHDT-Date: 1461967849 2016/04/29 22:10:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.49 $ */
|
||||
/* NetHack 3.6 wield.c $NHDT-Date: 1496614915 2017/06/04 22:21:55 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.53 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -676,6 +676,10 @@ uwepgone()
|
||||
pline("%s shining.", Tobjnam(uwep, "stop"));
|
||||
}
|
||||
setworn((struct obj *) 0, W_WEP);
|
||||
/* update takeoff mask in case uwep has just gone away while
|
||||
its removal via 'A' was pending, similar to what the various
|
||||
Xyzzy_off(do_wear.c) routines do for armor and accessories */
|
||||
context.takeoff.mask &= ~W_WEP;
|
||||
unweapon = TRUE;
|
||||
update_inventory();
|
||||
}
|
||||
@@ -686,6 +690,7 @@ uswapwepgone()
|
||||
{
|
||||
if (uswapwep) {
|
||||
setworn((struct obj *) 0, W_SWAPWEP);
|
||||
context.takeoff.mask &= ~W_SWAPWEP;
|
||||
update_inventory();
|
||||
}
|
||||
}
|
||||
@@ -695,6 +700,7 @@ uqwepgone()
|
||||
{
|
||||
if (uquiver) {
|
||||
setworn((struct obj *) 0, W_QUIVER);
|
||||
context.takeoff.mask &= ~W_QUIVER;
|
||||
update_inventory();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user