Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.)
- Loading branch information