]> granicus.if.org Git - nethack/commitdiff
fix #U1150 - burning armor with oil
authornethack.rankin <nethack.rankin>
Thu, 23 Sep 2004 02:39:35 +0000 (02:39 +0000)
committernethack.rankin <nethack.rankin>
Thu, 23 Sep 2004 02:39:35 +0000 (02:39 +0000)
     Objects which were destroyed by dipping them into lit potions of oil
didn't get unworn or unwielded in cases where that was needed.  This left a
stale pointer which could result in various strange things (user saw it be
formatted as "glorkum" but that isn't guaranteed) and there was no update of
any attributes or intrinsics conferred by the item, so persistent levitation
or water walking or dexterity boost could occur.

doc/fixes34.4
src/potion.c

index 76480e46885024fcf03c9639b8f96d1931503368..13bbef38da1088b14341d5ca6753b29eff2cf663 100644 (file)
@@ -52,6 +52,8 @@ killing a pet by displacing it into a trap now yields experience
 prevent a rolling boulder that is in motion from vanishing in bones files
 ensure that a sleeping steed doesn't answer a #chat
 eliminate two very minor anomalies when using Luck to adjust random numbers
+destroying a worn item via dipping in burning oil would not unwear/unwield
+       the item properly, possibly leading to various strange behaviors
 
 
 Platform- and/or Interface-Specific Fixes
index a25f1950111680e44e6e33411017b4a48ca8b6bd..1384267de7c10ed72b92638bf46f8de816cbf422 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)potion.c   3.4     2004/06/28      */
+/*     SCCS Id: @(#)potion.c   3.4     2004/09/22      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1896,10 +1896,12 @@ dodip()
                } else {
                    if ((omat == PLASTIC || omat == PAPER) && !obj->oartifact)
                        obj->oeroded = MAX_ERODE;
-                   pline_The("burning oil %s %s.",
+                   pline_The("burning oil %s %s%c",
                            obj->oeroded == MAX_ERODE ? "destroys" : "damages",
-                           yname(obj));
+                           yname(obj),
+                           obj->oeroded == MAX_ERODE ? '!' : '.');
                    if (obj->oeroded == MAX_ERODE) {
+                       if (obj->owornmask) remove_worn_item(obj, TRUE);
                        obj_extract_self(obj);
                        obfree(obj, (struct obj *)0);
                        obj = (struct obj *) 0;