fix #U1150 - burning armor with oil

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.
This commit is contained in:
nethack.rankin
2004-09-23 02:39:35 +00:00
parent d56fbeb761
commit c2d510a3f2
2 changed files with 7 additions and 3 deletions

View 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

View 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;