Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming
Home

[Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 26 Aug 2001 12:30:22 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Aug 25, 2001 at 07:02:22PM -0400, Ross W. Wetmore wrote:

Please resend the changes you made to server/gotohand.c:dir_ok and
straightest_direction. They are not simple cleanups.

Same file:
-    int dir;
-    int x, y;
     struct player *owner = unit_owner(punit);
-
-    for (dir = 0; dir < 8; dir++) {
-      x = map_adjust_x(src_x + DIR_DX[dir]);
-      y = map_adjust_y(src_y + DIR_DY[dir]);
-
+    adjc_dir_iterate(src_x,src_y,x,y,dir) {
       if (!dir_ok(dest_x, dest_y, punit->goto_dest_x, punit->goto_dest_y, dir))
        continue;
       if ((map_get_terrain(x, y) != T_OCEAN)
-         && is_enemy_unit_tile(map_get_tile(x, y), owner))
-       return 0;
              ^^^
-    }
+    && is_enemy_unit_tile(map_get_tile(x, y), owner))
+       return 1;
              ^^^
+    } adjc_dir_iterate_end;
     return 0;
   }
 }

Mistake?

I'm also not happy with the other changes you made to
server/gotohand.c. Yes I know some of the functions are very ugly. Can
you split your changes to a real cleanup one and another one which
does the rest of your algorithmic changes? So we get more eyes on the
latter one.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "Windows is the one true OS. MS invented the GUI. MS invented 
   the 32 bit OS. MS is open and standard. MS loves you. We have 
   always been at war with Oceana."


[Prev in Thread] Current Thread [Next in Thread]