fix issue #1407 - mon throw-and-return crash

Issue reported by k21971:  a gnome throwing a wielded aklys at the
hero was killed when failing to catch its return.  Bookkeeping for
dead monsters got messed up, then a crash occurred.

This fixes things.  Instead of a comment stating that the thrower
might be dead, kill it off.
This commit is contained in:
PatR
2025-04-05 09:44:02 -07:00
parent 4afb9254e1
commit 500af49dd3

View File

@@ -904,7 +904,8 @@ return_from_mtoss(struct monst *magr, struct obj *otmp, boolean tethered_weapon)
if (otmp->oartifact)
(void) artifact_hit((struct monst *) 0, magr, otmp, &dmg, 0);
magr->mhp -= dmg;
/* magr could be a DEADMONSTER now */
if (DEADMONSTER(magr))
monkilled(magr, canspotmon(magr) ? "" : (char *) 0, AD_PHYS);
}
if (notcaught) {
(void) snuff_candle(otmp);