diagonal movement glitch

|..X..
|.X}X.
|..X..
When testing the odd Samuari moats, I discovered that you could
easily walk diagonally between any two of the solid stone pillars
and fall into the water but you would always drown because it's a
no-teleport level and the crawl routine wouldn't let you back out
via that same diagonal.

The crawl routine is also being used by travel for the last step--a
post 3.6 change--so there was an unnecessary restriction on diagonal
movement there too.
This commit is contained in:
PatR
2021-08-02 17:44:03 -07:00
parent 5e4150be9a
commit e5f96cd329
3 changed files with 33 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 hack.c $NHDT-Date: 1617035736 2021/03/29 16:35:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.281 $ */
/* NetHack 3.7 hack.c $NHDT-Date: 1627951429 2021/08/03 00:43:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.291 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2969,7 +2969,8 @@ crawl_destination(int x, int y)
return FALSE;
/* finally, are we trying to squeeze through a too-narrow gap? */
return !(bad_rock(g.youmonst.data, u.ux, y)
&& bad_rock(g.youmonst.data, x, u.uy));
&& bad_rock(g.youmonst.data, x, u.uy)
&& cant_squeeze_thru(&g.youmonst));
}
/* something like lookaround, but we are not running */