From cc03c15978d30d0d09d977e219227b141204ef35 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Wed, 20 Apr 2011 23:46:33 +0000 Subject: [PATCH] fix #2142 - skipping levels when climbing with Amulet 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 | 1 + src/teleport.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 074291a5b..de8e38476 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -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 diff --git a/src/teleport.c b/src/teleport.c index 688f6a2a8..67870a820 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -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; -- 2.40.0