]> granicus.if.org Git - nethack/commitdiff
Fix panic on thrown potion of acid when swallowed
authorPasi Kallinen <paxed@alt.org>
Tue, 19 Apr 2022 11:56:51 +0000 (14:56 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 19 Apr 2022 12:00:00 +0000 (15:00 +0300)
When you're swallowed and throw a missile that kills the swallower,
the thrown missile is picked up by the swallower before death.
This caused a panic when you threw a potion, which was first picked up
by the swallower, which upon death dropped the potion on the floor,
but then throw code was trying to destroy the potion ...

src/mon.c

index 67b92a3777a79895595b411928b845cd714d4c8a..93ec686e0e49f4b323637956bdf634fa92d10ac8 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -2989,6 +2989,8 @@ xkilled(
         EDOG(mtmp)->killed_by_u = 1;
 
     if (wasinside && g.thrownobj && g.thrownobj != uball
+        /* don't give to mon if missile is going to be destroyed */
+        && g.thrownobj->oclass != POTION_CLASS
         /* don't give to mon if missile is going to return to hero */
         && g.thrownobj != (struct obj *) iflags.returning_missile) {
         /* thrown object has killed hero's engulfer; add it to mon's