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

@@ -1232,7 +1232,7 @@ dopois:
pline("%s %s.", Monnam(mtmp), mtmp->minvent ?
"brags about the goods some dungeon explorer provided" :
"makes some remarks about how difficult theft is lately");
if (!tele_restrict(mtmp)) rloc(mtmp);
if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
return 3;
} else if (mtmp->mcan) {
if (!Blind) {
@@ -1242,7 +1242,7 @@ dopois:
flags.female ? "unaffected" : "uninterested");
}
if(rn2(3)) {
if (!tele_restrict(mtmp)) rloc(mtmp);
if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
return 3;
}
break;
@@ -1255,7 +1255,7 @@ dopois:
break;
default:
if (!is_animal(mtmp->data) && !tele_restrict(mtmp))
rloc(mtmp);
(void) rloc(mtmp, FALSE);
if (is_animal(mtmp->data) && *buf) {
if (canseemon(mtmp))
pline("%s tries to %s away with %s.",
@@ -1359,7 +1359,7 @@ dopois:
mongone(mtmp);
return 2;
} else if (!rn2(33)) {
if (!tele_restrict(mtmp)) rloc(mtmp);
if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
monflee(mtmp, d(3, 6), TRUE, FALSE);
return 3;
}
@@ -2219,7 +2219,7 @@ register struct monst *mon;
if (uarm || uarmc) {
verbalize("You're such a %s; I wish...",
flags.female ? "sweet lady" : "nice guy");
if (!tele_restrict(mon)) rloc(mon);
if (!tele_restrict(mon)) (void) rloc(mon, FALSE);
return 1;
}
if (u.ualign.type == A_CHAOTIC)
@@ -2351,7 +2351,7 @@ register struct monst *mon;
#endif
}
if (!rn2(25)) mon->mcan = 1; /* monster is worn out */
if (!tele_restrict(mon)) rloc(mon);
if (!tele_restrict(mon)) (void) rloc(mon, FALSE);
return 1;
}