]> granicus.if.org Git - nethack/commitdiff
fix #H8183 - leather jacket doesn't show AC
authorPatR <rankin@nethack.org>
Tue, 12 Feb 2019 23:40:05 +0000 (15:40 -0800)
committerPatR <rankin@nethack.org>
Tue, 12 Feb 2019 23:40:05 +0000 (15:40 -0800)
Leather jacket doesn't take multiple turns to wear, so wearing it
wasn't calling Armor_on() and recently moved 'uarm->known = 1' didn't
get executed.  Not reported yet but had the same issue:  fedora and
dented pot wouldn't call Helmet_on().

doc/fixes36.2
src/do_wear.c

index 22fa781798901d945853bcf01743bfc43ca88b12..9c472f09b9b7f6f01d396a9fd952b8d5f43a486d 100644 (file)
@@ -1,4 +1,4 @@
-$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.255 $ $NHDT-Date: 1549849509 2019/02/11 01:45:09 $
+$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.257 $ $NHDT-Date: 1550014802 2019/02/12 23:40:02 $
 
 This fixes36.2 file is here to capture information about updates in the 3.6.x
 lineage following the release of 3.6.1 in April 2018. Please note, however,
@@ -427,6 +427,9 @@ when engulfed while in a shop, dropping an item into the engulfer and then
        using ':' to look at current location could cause a crash
 when items were on the floor just inside a shop's door where the shopkeeper
        doesn't buy and sell stuff, those items showed a 'for sale' price
+after 'when donning armor, enchanment becomes known even if interrupted' fix,
+       wearing a leather jacket, fedora, or dented pot (no multi-turn delay
+       worn in a slot which usually has one) didn't make +/- become known
 having an artifact wish be refused ("for a moment you feel <artifact> in
        your hands, but it disappears") would immediately segfault
 tty: turn off an optimization that is the suspected cause of Windows reported
index 0c3a4c1f8b23621f8b6ee6bad3d26a20bb32415f..793abfab58d98843bbf2e045253e6e81296430ca 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 do_wear.c       $NHDT-Date: 1549758452 2019/02/10 00:27:32 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.106 $ */
+/* NetHack 3.6 do_wear.c       $NHDT-Date: 1550014802 2019/02/12 23:40:02 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.107 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2012. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1928,26 +1928,31 @@ struct obj *obj;
         obj->known = 1;
          */
         setworn(obj, mask);
+        /* if there's no delay, we'll execute 'aftermv' immediately */
+        if (obj == uarm)
+            afternmv = Armor_on;
+        else if (obj == uarmh)
+            afternmv = Helmet_on;
+        else if (obj == uarmg)
+            afternmv = Gloves_on;
+        else if (obj == uarmf)
+            afternmv = Boots_on;
+        else if (obj == uarms)
+            afternmv = Shield_on;
+        else if (obj == uarmc)
+            afternmv = Cloak_on;
+        else if (obj == uarmu)
+            afternmv = Shirt_on;
+        else
+            panic("wearing armor not worn as armor? [%08lx]", obj->owornmask);
+
         delay = -objects[obj->otyp].oc_delay;
         if (delay) {
             nomul(delay);
             multi_reason = "dressing up";
-            if (is_boots(obj))
-                afternmv = Boots_on;
-            if (is_helmet(obj))
-                afternmv = Helmet_on;
-            if (is_gloves(obj))
-                afternmv = Gloves_on;
-            if (obj == uarm)
-                afternmv = Armor_on;
             nomovemsg = "You finish your dressing maneuver.";
         } else {
-            if (is_cloak(obj))
-                (void) Cloak_on();
-            if (is_shield(obj))
-                (void) Shield_on();
-            if (is_shirt(obj))
-                (void) Shirt_on();
+            unmul(""); /* call (*aftermv)(), clear it+nomovemsg+multi_reason */
             on_msg(obj);
         }
         context.takeoff.mask = context.takeoff.what = 0L;