]> granicus.if.org Git - nethack/commitdiff
ohitmon: obfree vs delobj
authorPatR <rankin@nethack.org>
Fri, 20 Aug 2021 22:06:05 +0000 (15:06 -0700)
committerPatR <rankin@nethack.org>
Fri, 20 Aug 2021 22:06:05 +0000 (15:06 -0700)
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.

src/mthrowu.c

index 93f10406f5a0837b40542da01256cf16d19d667a..1a45304e9ed4cca73b3c6b0181e9cadb7bd6ee0e 100644 (file)
@@ -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;
 }