From: cohrs Date: Sun, 3 Aug 2003 03:11:53 +0000 (+0000) Subject: U550 - grid bug travel redux X-Git-Tag: MOVE2GIT~1868 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=381f066a65bff9c84157b93c50e4a92843fc78ab;p=nethack U550 - grid bug travel redux Undo the change to test_move and instead, don't even test moving in diagonals. This opens the possibility for approximating the diagonal while polymorphed into a grid bug in the future. --- diff --git a/src/hack.c b/src/hack.c index bbc7da3e7..f50a49d42 100644 --- a/src/hack.c +++ b/src/hack.c @@ -553,9 +553,6 @@ int mode; register struct rm *tmpr = &levl[x][y]; register struct rm *ust; - /* no diagonal movement for grid bugs */ - if (dx && dy && u.umonnum == PM_GRID_BUG) return FALSE; - /* * Check for physical obstacles. First, the place we are going. */ @@ -743,8 +740,10 @@ boolean guess; int x = travelstepx[set][i]; int y = travelstepy[set][i]; static int ordered[] = { 0, 2, 4, 6, 1, 3, 5, 7 }; + /* no diagonal movement for grid bugs */ + int dirmax = u.umonnum == PM_GRID_BUG ? 4 : 8; - for (dir = 0; dir < 8; dir++) { + for (dir = 0; dir < dirmax; ++dir) { int nx = x+xdir[ordered[dir]]; int ny = y+ydir[ordered[dir]];