]> granicus.if.org Git - nethack/commitdiff
fix #H7631 - wielding cursed weptool via 'apply'
authorPatR <rankin@nethack.org>
Thu, 29 Nov 2018 11:49:16 +0000 (03:49 -0800)
committerPatR <rankin@nethack.org>
Thu, 29 Nov 2018 11:49:16 +0000 (03:49 -0800)
Applying a non-wielded cursed pick-axe first wielded it, then dug,
but it didn't report "pick-axe is welded to your hand".  (Attempting
to drop it or wield something else did report that, after the fact.)
The same thing happened if you used a pole-arm rather than pick-axe.

doc/fixes36.2
src/wield.c

index 134a4e45653154ae0c2d85f9915737d89768178a..7ecb9d247c6f100de1cc95ddecec4ca2567cd9bc 100644 (file)
@@ -226,6 +226,8 @@ for configurations with 'long int' larger than 'int', lev_comp wrote some
        garbage into the *.lev files, but nethack seemed unaffected by that
        (at least on little-endian hardare) and loaded the levels successfully
 stinking cloud placed near water could kill underwater creatures
+applying--rather than wielding--a cursed polearm or weapon-tool didn't report
+       that it had become welded to hero's hand(s)
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index 1063e125b8d63c4b4403d3ed283f8af4c283d780..701e2edcf916acecb90eacfb1c2fe0bb1d11df08 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 wield.c $NHDT-Date: 1525012623 2018/04/29 14:37:03 $  $NHDT-Branch: master $:$NHDT-Revision: 1.56 $ */
+/* NetHack 3.6 wield.c $NHDT-Date: 1543492132 2018/11/29 11:48:52 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.58 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2009. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -575,8 +575,13 @@ const char *verb; /* "rub",&c */
     } else {
         struct obj *oldwep = uwep;
 
-        You("now wield %s.", doname(obj));
-        setuwep(obj);
+        if (will_weld(obj)) {
+            /* hope none of ready_weapon()'s early returns apply here... */
+            (void) ready_weapon(obj);
+        } else {
+            You("now wield %s.", doname(obj));
+            setuwep(obj);
+        }
         if (flags.pushweapon && oldwep && uwep != oldwep)
             setuswapwep(oldwep);
     }