]> granicus.if.org Git - nethack/commitdiff
Fix: running on ice sent hero in weird directions
authorcopperwater <aosdict@gmail.com>
Tue, 7 Sep 2021 19:00:45 +0000 (15:00 -0400)
committercopperwater <aosdict@gmail.com>
Tue, 7 Sep 2021 19:17:33 +0000 (15:17 -0400)
This is because ice was being treated as a type of corridor rather than
a ROOM space, and running has rules for following similar terrain. In
reality it's not a corridor and should behave like normal room for
running purposes.

This was obvious in the valkyrie quest upper levels with ice fields, in
which running into the edges of the map obliquely, or into the corners
of the map, would send the hero flying around the edge in a different,
probably unintended direction.

src/hack.c

index dbb35303639fe47143162d14053a66bb5b1f95d8..bdbb03ce84a153369b368851d6ab409139a6f6c7 100644 (file)
@@ -2831,7 +2831,7 @@ lookaround(void)
 
             /* more uninteresting terrain */
             if (IS_ROCK(levl[x][y].typ) || levl[x][y].typ == ROOM
-                || IS_AIR(levl[x][y].typ)) {
+                || IS_AIR(levl[x][y].typ) || levl[x][y].typ == ICE) {
                 continue;
             } else if (closed_door(x, y) || (mtmp && is_door_mappear(mtmp))) {
                 /* a closed door? */