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.
This commit is contained in:
nethack.rankin
2011-04-20 23:46:33 +00:00
parent 2f1813cdd8
commit cc03c15978
2 changed files with 9 additions and 2 deletions

View 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

View 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;