]> granicus.if.org Git - nethack/commitdiff
Monster or hero placement should avoid wall of water
authorPasi Kallinen <paxed@alt.org>
Sun, 13 Feb 2022 16:06:45 +0000 (18:06 +0200)
committerPasi Kallinen <paxed@alt.org>
Sun, 13 Feb 2022 16:06:56 +0000 (18:06 +0200)
src/teleport.c

index 5df5d1dfdfd7a0b6c7c60fd4bc140b7cfda6b09f..a9bd26f3587579b5d4d6c32f0748fc9011f4f52e 100644 (file)
@@ -83,12 +83,14 @@ goodpos(int x, int y, struct monst* mtmp, long gpflags)
             if (mtmp == &g.youmonst)
                 return (Swimming || Amphibious
                         || (!Is_waterlevel(&u.uz)
+                            && !(levl[x][y].typ == WATER)
                             /* water on the Plane of Water has no surface
                                so there's no way to be on or above that */
                             && (Levitation || Flying || Wwalking)));
             else
                 return (is_swimmer(mdat)
                         || (!Is_waterlevel(&u.uz)
+                            && !(levl[x][y].typ == WATER)
                             && (is_floater(mdat) || is_flyer(mdat)
                                 || is_clinger(mdat))));
         } else if (mdat->mlet == S_EEL && rn2(13) && !ignorewater) {