diff --git a/src/mon.c b/src/mon.c index e90371bce..f73d258ec 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mon.c $NHDT-Date: 1426470347 2015/03/16 01:45:47 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.140 $ */ +/* NetHack 3.5 mon.c $NHDT-Date: 1429584308 2015/04/21 02:45:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.164 $ */ /* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1256,15 +1256,13 @@ dmonsfree() int count = 0; for (mtmp = &fmon; *mtmp;) { - freetmp = *mtmp; - if (freetmp->mhp <= 0 && !freetmp->isgd) { - if (freetmp == context.polearm.hitmon) - context.polearm.hitmon = NULL; - *mtmp = freetmp->nmon; - dealloc_monst(freetmp); - count++; - } else - mtmp = &(freetmp->nmon); + freetmp = *mtmp; + if (freetmp->mhp <= 0 && !freetmp->isgd) { + *mtmp = freetmp->nmon; + dealloc_monst(freetmp); + count++; + } else + mtmp = &(freetmp->nmon); } if (count != iflags.purge_monsters) @@ -1433,6 +1431,8 @@ m_detach(mtmp, mptr) struct monst *mtmp; struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */ { + if (mtmp == context.polearm.hitmon) + context.polearm.hitmon = 0; if (mtmp->mleashed) m_unleash(mtmp, FALSE); /* to prevent an infinite relobj-flooreffects-hmon-killed loop */ mtmp->mtrapped = 0; @@ -1720,7 +1720,11 @@ mongone(mdef) register struct monst *mdef; { mdef->mhp = 0; /* can skip some inventory bookkeeping */ - /* Player is thrown from his steed when it disappears */ + + /* dead vault guard is actually kept at coordinate <0,0> until + his temporary corridor to/from the vault has been removed */ + if (mdef->isgd && !grddead(mdef)) return; + /* hero is thrown from his steed when it disappears */ if (mdef == u.usteed) dismount_steed(DISMOUNT_GENERIC); diff --git a/src/vault.c b/src/vault.c index 87c13b31a..9a3fc0ef4 100644 --- a/src/vault.c +++ b/src/vault.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 vault.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vault.c $NHDT-Date: 1429584309 2015/04/21 02:45:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.33 $ */ /* NetHack 3.5 vault.c $Date: 2011/10/13 00:31:10 $ $Revision: 1.28 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -141,6 +141,8 @@ register struct monst *grd; relobj(grd, 0, FALSE); /* guard is dead; monster traversal loops should skip it */ grd->mhp = 0; + if (grd == context.polearm.hitmon) + context.polearm.hitmon = 0; /* see comment by newpos in gd_move() */ remove_monster(grd->mx, grd->my); newsym(grd->mx, grd->my);