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:
+2
-1
@@ -904,7 +904,8 @@ return_from_mtoss(struct monst *magr, struct obj *otmp, boolean tethered_weapon)
|
|||||||
if (otmp->oartifact)
|
if (otmp->oartifact)
|
||||||
(void) artifact_hit((struct monst *) 0, magr, otmp, &dmg, 0);
|
(void) artifact_hit((struct monst *) 0, magr, otmp, &dmg, 0);
|
||||||
magr->mhp -= dmg;
|
magr->mhp -= dmg;
|
||||||
/* magr could be a DEADMONSTER now */
|
if (DEADMONSTER(magr))
|
||||||
|
monkilled(magr, canspotmon(magr) ? "" : (char *) 0, AD_PHYS);
|
||||||
}
|
}
|
||||||
if (notcaught) {
|
if (notcaught) {
|
||||||
(void) snuff_candle(otmp);
|
(void) snuff_candle(otmp);
|
||||||
|
|||||||
Reference in New Issue
Block a user