From: Pasi Kallinen Date: Sun, 5 May 2019 19:29:47 +0000 (+0300) Subject: Fix impossible if monster cannot be relocated from tele region X-Git-Tag: NetHack-3.6.2_Released~6^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f55e9ddd7cffdeb0678986cf8b0160e29a2140a8;p=nethack Fix impossible if monster cannot be relocated from tele region --- diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 610c60161..ec12a701f 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -421,6 +421,7 @@ message given when shape-shifted vampire cheats death by reverting to its Vlad wasn't set up as a vampshifter properly poly'd hero capable of spitting venom would leave intact venom object if it reached end of range at a 'soft' location such as water +avoid impossible if monster cannot be relocated from teleport region Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/mkmaze.c b/src/mkmaze.c index 1b3959315..897830243 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -326,6 +326,8 @@ xchar rtype; boolean oneshot; d_level *lev; { + struct monst *mtmp; + if (bad_location(x, y, nlx, nly, nhx, nhy)) { if (!oneshot) { return FALSE; /* caller should try again */ @@ -346,11 +348,12 @@ d_level *lev; case LR_UPTELE: case LR_DOWNTELE: /* "something" means the player in this case */ - if (MON_AT(x, y)) { + if ((mtmp = m_at(x, y)) != 0) { /* move the monster if no choice, or just try again */ - if (oneshot) - (void) rloc(m_at(x, y), FALSE); - else + if (oneshot) { + if (!rloc(mtmp, TRUE)) + m_into_limbo(mtmp); + } else return FALSE; } u_on_newpos(x, y);