]> granicus.if.org Git - nethack/commit
fix #H167 - entering monster filled level
authornethack.rankin <nethack.rankin>
Sun, 13 Aug 2006 06:03:23 +0000 (06:03 +0000)
committernethack.rankin <nethack.rankin>
Sun, 13 Aug 2006 06:03:23 +0000 (06:03 +0000)
commit2e8c4b08d4e2af956738ec53e3d52380594794da
tree89ec31a0884da2a66b7f48424b859f360a7aff85
parentc91c9addb9fdc8cde2d4e9daf90b96447e8d2b18
fix #H167 - entering monster filled level

     When the hero arrives on a level and a monster at his destination can't
be relocated to make room for him, goto_level() would place the hero on top
of the monster.  From a bug report, who said that the
game panicked (without providing specifics, at least so far).  I wasn't able
to reproduce a panic but get a pair of impossible warnings and can confirm
that there is a monster on the same spot as the hero, which could easily
lead to strangeness depending upon what actions the monster attempts to
perform.  This fix causes a non-relocateable monster in that situation to
be moved to the migrating monsters list for later arrival back on that same
level.  That's inconsistant with the migrating monster arrival routine,
which kills off any monster it can't place; I'm not sure which action is
more reasonable, deferred arrival or outright removal.

     There are three or four dozen ``(void) rloc(mon)'' calls which don't
do anything special when rloc fails to move the monster.  Those need to be
reviewed and the ones where it's making a space for some other monster have
to do something about failure.  (Failed teleport attempts can simply leave
the monster in place, so most of those calls won't need any extra handling.)
doc/fixes34.4
src/do.c