Suggest only accessible positions for polearms and jumping

This commit is contained in:
Pasi Kallinen
2015-04-03 12:29:58 +03:00
parent 0344771b12
commit 30bce1ec6b

View 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);