fix #H6648 - can't wear via 'W' but can via 'P'
authorPatR <rankin@nethack.org>
Sat, 23 Dec 2017 23:42:20 +0000 (15:42 -0800)
committerPatR <rankin@nethack.org>
Sat, 23 Dec 2017 23:42:20 +0000 (15:42 -0800)
More fallout from allowing W/T on accessories and P/R on armor without
combining them outright.  If poly'd into verysmall or nohands critter,
'W' yields "don't even bother" before even prompting what to wear, but
'P' would prompt for an accessory and then wear armor if that was what
got picked.  Now 'P' will still prompt, in case it's for an accessory,
but picking a piece of armor no longer wears that armor.

'W' still doesn't even prompt, so won't allow accessories as well as
no armor.  I'm not sure whether that should be changed.

doc/fixes36.1
src/do_wear.c

index 80e7927669841f279bb76136bcef580d8d34ae9c..69724485b5f73350010ab0a310f4a7fb9559527f 100644 (file)
@@ -490,6 +490,8 @@ if a fiery monster, wand of fire, or fiery explosion burned up a paper golem,
        it could still leave blank scrolls
 hero poly'd into paper or straw golem reverts to human if burned up even when
        Unchanging without any explanation given
+hero polymorphed into form which can't wear armor via 'W' (eliciting "don't
+       even bother") could wear it via 'P'
 
 
 Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
index 2adcb68160c29eca0e9e0b0e902a7734f66e2263..f8f94e342fdeb2aa245c81242545ba38c49bd828 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 do_wear.c       $NHDT-Date: 1496959478 2017/06/08 22:04:38 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.98 $ */
+/* NetHack 3.6 do_wear.c       $NHDT-Date: 1514072526 2017/12/23 23:42:06 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.100 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1617,6 +1617,14 @@ boolean noisy;
     int err = 0;
     const char *which;
 
+    /* this is the same check as for 'W' (dowear), but different message,
+       in case we get here via 'P' (doputon) */
+    if (verysmall(youmonst.data) || nohands(youmonst.data)) {
+        if (noisy)
+            You("can't wear any armor in your current form.");
+        return 0;
+    }
+
     which = is_cloak(otmp)
                 ? c_cloak
                 : is_shirt(otmp)
@@ -1964,7 +1972,7 @@ dowear()
 
     /* cantweararm() checks for suits of armor, not what we want here;
        verysmall() or nohands() checks for shields, gloves, etc... */
-    if ((verysmall(youmonst.data) || nohands(youmonst.data))) {
+    if (verysmall(youmonst.data) || nohands(youmonst.data)) {
         pline("Don't even bother.");
         return 0;
     }