]> granicus.if.org Git - nethack/commitdiff
Suggest only accessible positions for polearms and jumping
authorPasi Kallinen <paxed@alt.org>
Fri, 3 Apr 2015 09:29:58 +0000 (12:29 +0300)
committerPasi Kallinen <paxed@alt.org>
Fri, 3 Apr 2015 09:29:58 +0000 (12:29 +0300)
src/apply.c

index aec7550a226aeaa4e61c20525e6b467b67d28c21..10bfdfd2361b0138e02509753e7220ead35d9bb1 100644 (file)
@@ -1403,7 +1403,8 @@ int state;
            for (dy = -4; dy <= 4; dy++) {
                x = dx + (int)u.ux;
                y = dy + (int)u.uy;
-               if (isok(x,y) && is_valid_jump_pos(x,y, jumping_is_magic, FALSE))
+               if (isok(x,y) && ACCESSIBLE(levl[x][y].typ) &&
+                   is_valid_jump_pos(x,y, jumping_is_magic, FALSE))
                    tmp_at(x,y);
            }
     } else {
@@ -2611,7 +2612,7 @@ int state;
            for (dy = -4; dy <= 4; dy++) {
                x = dx + (int)u.ux;
                y = dy + (int)u.uy;
-               if (isok(x, y) &&
+               if (isok(x, y) && ACCESSIBLE(levl[x][y].typ) &&
                    distu(x, y) >= polearm_range_min &&
                    distu(x, y) <= polearm_range_max) {
                    tmp_at(x, y);