buglist - full level triggers impossible() from migrating mons

<email deleted> wrote:
> If more monsters fall through a trap door than can fit on the
> level below, when you go down the stairs, you get the following
> message:
>  "Program in disorder - perhaps you'd better #quit.
>  rloc(): couldn't relocate monster"
> This message seems to appear once for every monster-too-many that
> fell through the hole. I originally found this while
> intentionally completely filling a level with black puddings
> (there was a trap door I didn't know about). I also confirmed it
> in a wiz-mode test using gremlins and water.

[confirmed: moveloop -> deferred_goto -> goto_level ->
 losedogs -> mon_arrive -> rloc -> impossible]

This patch:
- causes rloc() to return TRUE if successful,
  or FALSE if it wasn't.
- adds code to mon_arrive() in dog.c to deal with
  the failed rloc()
- allows the x,y parameters to mkcorpstat() to
  be 0,0 in order to trigger random placement of the
  corpse on the level
- if you define DEBUG_MIGRATING_MONS when you build cmd.c
  then you'll have a debug-mode command #migratemons to
  store the number of random monsters that you specify
  on the migrating monsters chain.
This commit is contained in:
nethack.allison
2003-09-13 05:30:43 +00:00
parent 32b2af4abf
commit cc830fb311
24 changed files with 134 additions and 53 deletions

View File

@@ -327,7 +327,7 @@ register struct monst *mtmp;
/* some monsters teleport */
if (mtmp->mflee && !rn2(40) && can_teleport(mdat) && !mtmp->iswiz &&
!level.flags.noteleport) {
rloc(mtmp);
(void) rloc(mtmp, FALSE);
return(0);
}
if (mdat->msound == MS_SHRIEK && !um_dist(mtmp->mx, mtmp->my, 1))
@@ -370,7 +370,7 @@ register struct monst *mtmp;
if (is_demon(youmonst.data)) {
/* "Good hunting, brother" */
if (!tele_restrict(mtmp)) rloc(mtmp);
if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
} else {
mtmp->minvis = mtmp->perminvis = 0;
/* Why? For the same reason in real demon talk */
@@ -680,7 +680,7 @@ register int after;
if(ptr == &mons[PM_TENGU] && !rn2(5) && !mtmp->mcan &&
!tele_restrict(mtmp)) {
if(mtmp->mhp < 7 || mtmp->mpeaceful || rn2(2))
rloc(mtmp);
(void) rloc(mtmp, FALSE);
else
mnexto(mtmp);
mmoved = 1;
@@ -1014,7 +1014,7 @@ not_special:
if (mtmp->wormno) worm_move(mtmp);
} else {
if(is_unicorn(ptr) && rn2(2) && !tele_restrict(mtmp)) {
rloc(mtmp);
(void) rloc(mtmp, FALSE);
return(1);
}
if(mtmp->wormno) worm_nomove(mtmp);