From: PatR Date: Fri, 20 Aug 2021 22:06:05 +0000 (-0700) Subject: ohitmon: obfree vs delobj X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=191a1b01b87929f750480bac38df47eb6629bf66;p=nethack ohitmon: obfree vs delobj Make missiles that aren't launched by the hero and that hit a monster use the routine that protects the Amulet and invocation items against being deleted. I don't think there are any cases where this matters because those items don't break when they hit something, but be more cautious. --- diff --git a/src/mthrowu.c b/src/mthrowu.c index 93f10406f..1a45304e9 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mthrowu.c $NHDT-Date: 1620923922 2021/05/13 16:38:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.114 $ */ +/* NetHack 3.7 mthrowu.c $NHDT-Date: 1629497158 2021/08/20 22:05:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.117 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2016. */ /* NetHack may be freely redistributed. See license for details. */ @@ -154,7 +154,7 @@ drop_throw( } } } else - obfree(obj, (struct obj *) 0); + delobj(obj); return retvalu; }