]> granicus.if.org Git - nethack/commitdiff
Fix impossible if monster cannot be relocated from tele region
authorPasi Kallinen <paxed@alt.org>
Sun, 5 May 2019 19:29:47 +0000 (22:29 +0300)
committerPasi Kallinen <paxed@alt.org>
Sun, 5 May 2019 19:30:20 +0000 (22:30 +0300)
doc/fixes36.2
src/mkmaze.c

index 610c601614e49f18cdeaeb24490864249060ed4a..ec12a701fc5065b81deb33e896555c3f747bff4e 100644 (file)
@@ -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
index 1b39593153f4920d2be5b94e07a52415fadc47e3..897830243b059dd54bff4a06d1011a804c80c639 100644 (file)
@@ -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);