diff --git a/src/do.c b/src/do.c index 5a856b3e0..5daf92024 100644 --- a/src/do.c +++ b/src/do.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)do.c 3.5 2007/05/21 */ +/* SCCS Id: @(#)do.c 3.5 2008/01/22 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1044,6 +1044,10 @@ boolean at_stairs, falling, portal; if (on_level(newlevel, &u.uz)) return; /* this can happen */ + /* tethered movement makes level change while trapped feasible */ + if (u.utrap && u.utraptype == TT_BURIEDBALL) + buried_ball_to_punishment(); /* (before we save/leave old level) */ + fd = currentlevel_rewrite(); if (fd < 0) return; diff --git a/src/hack.c b/src/hack.c index 5c0806de8..0ca5f1aac 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1053,6 +1053,23 @@ struct trap *desttrap; /* nonnull if another trap at */ case TT_INFLOOR: case TT_BURIEDBALL: anchored = (u.utraptype == TT_BURIEDBALL); + if (anchored) { + coord cc; + + cc.x = u.ux, cc.y = u.uy; + /* can move normally within radius 1 of buried ball */ + if (buried_ball(&cc) && dist2(x, y, cc.x, cc.y) <= 2) { + /* ugly hack: we need to issue some message here + in case "you are chained to the buried ball" + was the most recent message given, otherwise + our next attempt to move out of tether range + after this successful move would have its + can't-do-that message suppressed by Norep */ + if (flags.verbose) + Norep("You move within the chain's reach."); + return TRUE; + } + } if (--u.utrap) { if (flags.verbose) { if (anchored) {