]> granicus.if.org Git - nethack/commitdiff
'A' interruption
authorPatR <rankin@nethack.org>
Sun, 4 Jun 2017 03:34:03 +0000 (20:34 -0700)
committerPatR <rankin@nethack.org>
Sun, 4 Jun 2017 03:34:03 +0000 (20:34 -0700)
Extend the 'A' blindfold fix from three weeks ago to cover weapons
too.  This might fix the problem being caught via curse(NULL) when
using 'A' to remove multiple items.  The blindfold bug was straight-
forward since it was requiring two turns but not checking for loss
of blindfold when interrupted by theft.  Weapon/alt-weapon/quiver
each only need one turn so I'm not sure what's really happening to
trigger problems for them.

src/do_wear.c

index e60df04dccad5e0a5af684ac0aee886ed5bb0bf6..197e69e80955c9cf52ce0f7f5333587df92e4f98 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 do_wear.c       $NHDT-Date: 1494545163 2017/05/11 23:26:03 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.95 $ */
+/* NetHack 3.6 do_wear.c       $NHDT-Date: 1496547229 2017/06/04 03:33:49 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.96 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1241,6 +1241,12 @@ struct obj *otmp;
         result = (what == RIGHT_RING);
     else if (otmp == ublindf)
         result = (what == WORN_BLINDF);
+    else if (otmp == uwep)
+        result = (what == W_WEP);
+    else if (otmp == uswapwep)
+        result = (what == W_SWAPWEP);
+    else if (otmp == uquiver)
+        result = (what == W_QUIVER);
 
     return result;
 }
@@ -1279,6 +1285,12 @@ struct obj *otmp;
         result = (what == RIGHT_RING);
     else if (otmp == ublindf)
         result = (what == WORN_BLINDF);
+    else if (otmp == uwep)
+        result = (what == W_WEP);
+    else if (otmp == uswapwep)
+        result = (what == W_SWAPWEP);
+    else if (otmp == uquiver)
+        result = (what == W_QUIVER);
 
     return result;
 }
@@ -1323,7 +1335,7 @@ struct obj *stolenobj; /* no message if stolenobj is already being doffing */
     cancel_don();
     /* don't want <armor>_on() or <armor>_off() being called
        by unmul() since the on or off action isn't completing */
-    afternmv = 0;
+    afternmv = (int NDECL((*))) 0;
     if (putting_on || otmp != stolenobj) {
         Sprintf(buf, "You stop %s %s.",
                 putting_on ? "putting on" : "taking off",