B08012 - tweaking travel and closed doors
- when testing travel locations, don't treat diagonal moves thru closed doors as possible, unless player can go/dig thru door - treat closed doors and boulders as expensive for travel, preferring open paths
This commit is contained in:
+25
-10
@@ -600,19 +600,22 @@ int mode;
|
|||||||
}
|
}
|
||||||
} else pline("That door is closed.");
|
} else pline("That door is closed.");
|
||||||
}
|
}
|
||||||
}
|
} else if (mode == TEST_TRAV) goto testdiag;
|
||||||
if (mode != TEST_TRAV) return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else if (dx && dy && !Passes_walls
|
} else {
|
||||||
&& ((tmpr->doormask & ~D_BROKEN)
|
testdiag:
|
||||||
|
if (dx && dy && !Passes_walls
|
||||||
|
&& ((tmpr->doormask & ~D_BROKEN)
|
||||||
#ifdef REINCARNATION
|
#ifdef REINCARNATION
|
||||||
|| Is_rogue_level(&u.uz)
|
|| Is_rogue_level(&u.uz)
|
||||||
#endif
|
#endif
|
||||||
|| block_door(x,y))) {
|
|| block_door(x,y))) {
|
||||||
/* Diagonal moves into a door are not allowed. */
|
/* Diagonal moves into a door are not allowed. */
|
||||||
if (Blind && mode == DO_MOVE)
|
if (Blind && mode == DO_MOVE)
|
||||||
feel_location(x,y);
|
feel_location(x,y);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dx && dy
|
if (dx && dy
|
||||||
@@ -734,6 +737,18 @@ boolean guess;
|
|||||||
int ny = y+ydir[ordered[dir]];
|
int ny = y+ydir[ordered[dir]];
|
||||||
|
|
||||||
if (!isok(nx, ny)) continue;
|
if (!isok(nx, ny)) continue;
|
||||||
|
if ((!Passes_walls && !can_ooze(&youmonst) &&
|
||||||
|
closed_door(x, y)) || sobj_at(BOULDER, x, y)) {
|
||||||
|
/* closed doors and boulders usually
|
||||||
|
* cause a delay, so prefer another path */
|
||||||
|
if (travel[x][y] > radius-3) {
|
||||||
|
travelstepx[1-set][nn] = x;
|
||||||
|
travelstepy[1-set][nn] = y;
|
||||||
|
/* don't change travel matrix! */
|
||||||
|
nn++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (test_move(x, y, nx-x, ny-y, TEST_TRAV) &&
|
if (test_move(x, y, nx-x, ny-y, TEST_TRAV) &&
|
||||||
(levl[nx][ny].seenv || (!Blind && couldsee(nx, ny)))) {
|
(levl[nx][ny].seenv || (!Blind && couldsee(nx, ny)))) {
|
||||||
if (nx == ux && ny == uy) {
|
if (nx == ux && ny == uy) {
|
||||||
|
|||||||
Reference in New Issue
Block a user