]> granicus.if.org Git - nethack/commitdiff
fix #2142 - skipping levels when climbing with Amulet
authornethack.rankin <nethack.rankin>
Wed, 20 Apr 2011 23:46:33 +0000 (23:46 +0000)
committernethack.rankin <nethack.rankin>
Wed, 20 Apr 2011 23:46:33 +0000 (23:46 +0000)
     From a bug report,
when climbing out of Gehennom while carrying the Amulet, you could skip
a handful of levels by taking the magic portal into the Wizard's Tower,
dropping the Amulet, zapping it with a wand of teleportation--possibly
more than once--until it lands outside the tower.  Then take the portal
back out of the tower and level teleport--feasible now that you're not
carrying the Amulet any more--back to the tower level and retrieve the
Amulet.  Overall probably not much of a savings unless you're having
really bad luck with the mysterious force sending you back whenever you
try to go up.  The hero and monsters can't teleport from inside the tower
to the outside or vice versa; this gives the same limitation to objects.

doc/fixes34.4
src/teleport.c

index 074291a5b97a896d15e3f726b76f0f7c164d70f0..de8e38476484eec186e6347c093deba410b87036 100644 (file)
@@ -404,6 +404,7 @@ when polymorphed into an opposite sex monster, if you then become a new
 the weight of a non-cursed bag of holding was sometimes off by 1 unit
 for number_pad:2 (MSDOS compatibility), M-5 (Alt+5, or Shift+keypad5 using
        MSDOS/Windows keystroke hackery) didn't function as G movement prefix
+objects inside the Wizard's Tower can't be teleport to outside and vica versa
 
 
 Platform- and/or Interface-Specific Fixes
index 688f6a2a8d81ff786001408c24827c5c04461842..67870a82077849e1cfd332734525d4217397600e 100644 (file)
@@ -1231,13 +1231,19 @@ register struct obj *obj;
            ty = rn2(ROWNO);
            if (!--try_limit) break;
        } while (!goodpos(tx, ty, (struct monst *)0, 0) ||
-               /* bug: this lacks provision for handling the Wizard's tower */
                 (restricted_fall &&
                  (!within_bounded_area(tx, ty, dndest.lx, dndest.ly,
                                                dndest.hx, dndest.hy) ||
                   (dndest.nlx &&
                    within_bounded_area(tx, ty, dndest.nlx, dndest.nly,
-                                               dndest.nhx, dndest.nhy)))));
+                                               dndest.nhx, dndest.nhy)))) ||
+                /* on the Wizard Tower levels, objects inside should
+                   stay inside and objects outside should stay outside */
+                (dndest.nlx && On_W_tower_level(&u.uz) &&
+                 within_bounded_area(tx, ty, dndest.nlx, dndest.nly,
+                                             dndest.nhx, dndest.nhy) !=
+                 within_bounded_area(otx, oty, dndest.nlx, dndest.nly,
+                                               dndest.nhx, dndest.nhy)));
 
        if (flooreffects(obj, tx, ty, "fall")) {
            return FALSE;