displacing grid bugs (trunk only)

From a bug report, you could swap places with a pet grid bug when
you're making a diagonal move.  Now you can't.  [Completely ignored:  it
is possible to swap places with pets which are incapable of movement....]

     This imposes the same restriction on the astral Riders when they're
exchanging places with monsters in their way.
This commit is contained in:
nethack.rankin
2007-07-13 23:40:43 +00:00
parent 382bbf7f8e
commit 1a9c99797a
3 changed files with 11 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)hack.c 3.5 2007/04/16 */
/* SCCS Id: @(#)hack.c 3.5 2007/07/13 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1401,6 +1401,11 @@ domove()
sobj_at(BOULDER, trap->tx, trap->ty)) {
/* can't swap places with pet pinned in a pit by a boulder */
u.ux = u.ux0, u.uy = u.uy0; /* didn't move after all */
} else if (u.ux0 != x && u.uy0 != y && NODIAG(mtmp->data - mons)) {
/* can't swap places when pet can't move to your spot */
u.ux = u.ux0, u.uy = u.uy0;
You("stop. %s can't move diagonally.",
upstart(y_monnam(mtmp)));
} else if (u.ux0 != x && u.uy0 != y &&
bad_rock(mtmp->data, x, u.uy0) &&
bad_rock(mtmp->data, u.ux0, y) &&