Prevent diagonal jump through open door

This commit is contained in:
Pasi Kallinen
2016-06-11 19:27:50 +03:00
parent 9ad584523f
commit b75ce0b996

View File

@@ -544,9 +544,15 @@ int x, y;
}
if (!Passes_walls || !(may_pass = may_passwall(x, y))) {
if (IS_ROCK(levl[x][y].typ) || closed_door(x, y)) {
boolean odoor_diag = (IS_DOOR(levl[x][y].typ)
&& (levl[x][y].doormask & D_ISOPEN)
&& (u.ux - x) && (u.uy - y));
if (IS_ROCK(levl[x][y].typ) || closed_door(x, y)
|| odoor_diag) {
const char *s;
if (odoor_diag)
You("hit the door edge!");
pline("Ouch!");
if (IS_TREE(levl[x][y].typ))
s = "bumping into a tree";