]> granicus.if.org Git - nethack/commitdiff
teleporting monster while swallowed
authorcohrs <cohrs>
Sat, 2 Feb 2002 06:43:53 +0000 (06:43 +0000)
committercohrs <cohrs>
Sat, 2 Feb 2002 06:43:53 +0000 (06:43 +0000)
if player teleports a monster while swallowed on a noteleport level, the
player should not teleport along with the monster

doc/fixes33.2
src/teleport.c

index 05629d5c2b2ab5714b3ee65a3bd97444a5cea9f6..033c0d98c07f69c55861c354a13bb1c52699f29c 100644 (file)
@@ -414,6 +414,8 @@ eggs, potions & other breakables may break when they fall down stairs
 hurtling via grappling hook does not apply effects of destination location
 consider vortexes to be nonliving
 dragons have scales, not fur
+if player teleports a monster while swallowed on a noteleport level, the
+       player should not teleport along with the monster
 
 
 Platform- and/or Interface-Specific Fixes
index 8d63c3e8ee022eb4c0a17ee57c5c5a1c2843eef6..85d38c78823a47fe3a6cf1d3c04fe01e808a11fa 100644 (file)
@@ -1147,14 +1147,17 @@ boolean give_feedback;
            if (give_feedback)
                pline("%s resists your magic!", Monnam(mtmp));
            return FALSE;
-       } else {
-           if (is_rider(mtmp->data) && rn2(13) &&
-                   enexto(&cc, u.ux, u.uy, mtmp->data))
-               rloc_to(mtmp, cc.x, cc.y);
-           else
-               rloc(mtmp);
-           return TRUE;
-       }
+       } else if (level.flags.noteleport && u.uswallow && mtmp == u.ustuck) {
+           if (give_feedback)
+               You("are no longer inside %s!", mon_nam(mtmp));
+           unstuck(mtmp);
+           rloc(mtmp);
+       } else if (is_rider(mtmp->data) && rn2(13) &&
+                  enexto(&cc, u.ux, u.uy, mtmp->data))
+           rloc_to(mtmp, cc.x, cc.y);
+       else
+           rloc(mtmp);
+       return TRUE;
 }
 
 /*teleport.c*/