mongone vs vault guard

mongone() would send away a vault guard, whether alive or already
dead and parked at <0,0>, losing the information needed to remove
the temporary vault corridor once whatever obstacle (ie, the hero)
that's keeping it in place has been cleared.  Have mongone() call
grddead() like mondead() does, so that a guard will just be moved
to <0,0> with 0 HP and kept there rather than being purged during
the next dead monster removal.

Move polearm context reset to m_detach() [and, unfortunately,
duplicated in grddead()] rather than in having it in dmonsfree()
since execution of the latter is deferred.  I'm not sure offhand
whether a fast hero could get a second move before end-of-turn
purging of dead monsters.
This commit is contained in:
PatR
2015-04-20 19:45:13 -07:00
parent 32ed364086
commit 7bbf292c92
2 changed files with 18 additions and 12 deletions

View File

@@ -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);