]> granicus.if.org Git - nethack/commitdiff
fix #M132 - Sunsword glows after its wielder dies
authornethack.rankin <nethack.rankin>
Fri, 15 Jul 2005 02:57:21 +0000 (02:57 +0000)
committernethack.rankin <nethack.rankin>
Fri, 15 Jul 2005 02:57:21 +0000 (02:57 +0000)
     When lit due to being wielded by a monster, Sunsword continued to emit
light after that monster was killed.  This was fixed by <Someone> 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
src/steal.c

index cd3fd9081063b69192c650784849ad24bb22bac3..1be2f3de05c2606334a9ceacb4f95fe82dc713d3 100644 (file)
@@ -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
index 7043daad4644af49a113077889b33ddd0321b998..d3225a8bd0cb764feff7d351b8bd262d6a471e14 100644 (file)
@@ -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")) {