[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]
Raimar Falke wrote:
>
> 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've looked over this code several times, and right now it all boils
down to "return 0;". Note that the function it is in (in
server/gotohand.c) has an exact correspondence with a same-name function
in client/gotohand.c...but the server function has this extra code.
There's a comment saying it's necessary, but it's certainly not doing
anything useful right now.
I'm much more inclined to think the code is buggy as it is now.
jason
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, (continued)
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Jason Dorje Short, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Jason Dorje Short, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Ross W. Wetmore, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Ross W. Wetmore, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Jason Dorje Short, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Ross W. Wetmore, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming,
Jason Dorje Short <=
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Ross W. Wetmore, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Ross W. Wetmore, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Ross W. Wetmore, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Ross W. Wetmore, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part1 has been put in incoming, Jason Dorje Short, 2001/08/26
|
|