From a1b4bce87c871e22cf51ae43e3e1ea0e58658aa7 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 15 Jul 2005 02:57:21 +0000 Subject: [PATCH] fix #M132 - Sunsword glows after its wielder dies When lit due to being wielded by a monster, Sunsword continued to emit light after that monster was killed. This was fixed by in 3.4.1 but a change I made for 3.4.3 broke that fix. When mdrop_obj() was split out of relobj(), relevant unwielding code ended up only being executed for monsters who were still alive. --- doc/fixes34.4 | 2 ++ src/steal.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index cd3fd9081..1be2f3de0 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -134,6 +134,8 @@ recognize if hero has already entered Gehennom by means other than usual route so that prompt can be skipped if Valley's stairs are subsequently used once you've passed the Valley, drawbridge tune is no longer a prayer reward fix up grammar and punctuation in variants of shopkeeper's price message +regression, bug fixed in 3.4.1 reintroduced in 3.4.3: Sunsword continued to + emit light after monster who was wielding got killed Platform- and/or Interface-Specific Fixes diff --git a/src/steal.c b/src/steal.c index 7043daad4..d3225a8bd 100644 --- a/src/steal.c +++ b/src/steal.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)steal.c 3.5 2005/02/09 */ +/* SCCS Id: @(#)steal.c 3.5 2005/07/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -531,8 +531,6 @@ boolean verbosely; if (mon->mhp > 0) { mon->misc_worn_check &= ~obj->owornmask; update_mon_intrinsics(mon, obj, FALSE, TRUE); - /* obj_no_longer_held(obj); -- done by place_object */ - if (obj->owornmask & W_WEP) setmnotwielded(mon, obj); #ifdef STEED /* don't charge for an owned saddle on dead steed */ } else if (mon->mtame && (obj->owornmask & W_SADDLE) && @@ -540,8 +538,11 @@ boolean verbosely; obj->no_charge = 1; #endif } + /* this should be done even if the monster has died */ + if (obj->owornmask & W_WEP) setmnotwielded(mon, obj); obj->owornmask = 0L; } + /* obj_no_longer_held(obj); -- done by place_object */ if (verbosely && cansee(omx, omy)) pline("%s drops %s.", Monnam(mon), distant_name(obj, doname)); if (!flooreffects(obj, omx, omy, "fall")) {