From: Pasi Kallinen Date: Tue, 19 Apr 2022 11:56:51 +0000 (+0300) Subject: Fix panic on thrown potion of acid when swallowed X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af7db2f8f1df2a77f30f52589832a74cf5408e53;p=nethack Fix panic on thrown potion of acid when swallowed 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 ... --- diff --git a/src/mon.c b/src/mon.c index 67b92a377..93ec686e0 100644 --- 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