From a41d63d146b7a7ad9e4c2f99730e939e69cc295c Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 12 Feb 2019 15:40:05 -0800 Subject: [PATCH] fix #H8183 - leather jacket doesn't show AC 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 | 5 ++++- src/do_wear.c | 35 ++++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 22fa78179..9c472f09b 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -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 in your hands, but it disappears") would immediately segfault tty: turn off an optimization that is the suspected cause of Windows reported diff --git a/src/do_wear.c b/src/do_wear.c index 0c3a4c1f8..793abfab5 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -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; -- 2.40.0