fix grid bug travel bug

From a bug report, grid bug could travel 1 step diagonally
due to special case code in findtravelpath that did not check grid bug
movement restriction
This commit is contained in:
cohrs
2010-12-30 21:47:06 +00:00
parent 8a5ff16e99
commit 9b1f0899b0
2 changed files with 3 additions and 1 deletions

View File

@@ -789,7 +789,8 @@ findtravelpath(guess)
boolean guess;
{
/* if travel to adjacent, reachable location, use normal movement rules */
if (!guess && context.travel1 && distmin(u.ux, u.uy, u.tx, u.ty) == 1) {
if (!guess && context.travel1 && distmin(u.ux, u.uy, u.tx, u.ty) == 1 &&
!(u.ux != u.tx && u.uy != u.ty && NODIAG(u.umonnum))) {
context.run = 0;
if (test_move(u.ux, u.uy, u.tx-u.ux, u.ty-u.uy, TEST_MOVE)) {
u.dx = u.tx-u.ux;