]> granicus.if.org Git - nethack/commitdiff
U550 - grid bug travel redux
authorcohrs <cohrs>
Sun, 3 Aug 2003 03:11:53 +0000 (03:11 +0000)
committercohrs <cohrs>
Sun, 3 Aug 2003 03:11:53 +0000 (03:11 +0000)
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.

src/hack.c

index bbc7da3e7304b81e2a848f741c76181d5219fa9b..f50a49d424db6d2bebcffde4c2a0b107881a934e 100644 (file)
@@ -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]];