]> granicus.if.org Git - nethack/commitdiff
Wall of water should block monster lined-up checks
authorPasi Kallinen <paxed@alt.org>
Sun, 13 Feb 2022 15:21:57 +0000 (17:21 +0200)
committerPasi Kallinen <paxed@alt.org>
Sun, 13 Feb 2022 15:22:00 +0000 (17:22 +0200)
Prevents monsters from eg. throwing items through the water.

src/mthrowu.c

index cf775ec7da5d464aabae196579fd18355ad531bf..7f546d8157c01b69178bebb37a9a1d60e3fb0537 100644 (file)
@@ -1037,7 +1037,8 @@ linedup_callback(
             bx += dx, by += dy;
             if (!isok(bx, by))
                 return FALSE;
-            if (IS_ROCK(levl[bx][by].typ) || closed_door(bx, by))
+            if (IS_ROCK(levl[bx][by].typ) || closed_door(bx, by)
+                || levl[bx][by].typ == WATER)
                 return FALSE;
             if ((*fnc)(bx, by))
                 return TRUE;
@@ -1080,7 +1081,8 @@ linedup(
         do {
             /* <bx,by> is guaranteed to eventually converge with <ax,ay> */
             bx += dx, by += dy;
-            if (IS_ROCK(levl[bx][by].typ) || closed_door(bx, by))
+            if (IS_ROCK(levl[bx][by].typ) || closed_door(bx, by)
+                || levl[bx][by].typ == WATER)
                 return FALSE;
             if (sobj_at(BOULDER, bx, by))
                 ++boulderspots;