Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: [PATCH] base_real_map_distance (PR#1049)
Home

[Freeciv-Dev] Re: [PATCH] base_real_map_distance (PR#1049)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] base_real_map_distance (PR#1049)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Sun, 2 Dec 2001 20:36:01 +0100

Hi,

  sorry I respond to so old mail, however I didn't find the patch which
just got into CVS here and this is only mail where I discovered this change.
I just had a look what changed in the code I actually clean, and basically 
following:

> Index: server/settlers.c
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/server/settlers.c,v
> retrieving revision 1.112
> diff -u -r1.112 settlers.c
> --- server/settlers.c 2001/10/14 21:02:17     1.112
> +++ server/settlers.c 2001/11/01 14:09:33
> @@ -769,8 +769,8 @@
>    for (i = 0; i < game.nplayers; i++) {
>      city_list_iterate(game.players[i].cities, pcity) {
>        if (map_distance(x, y, pcity->x, pcity->y)<=8) {
> -        dx = xdist(pcity->x, x);
> -        dy = ydist(pcity->y, y);
> +     base_real_map_distance(&dx, &dy, pcity->x, pcity->y, x, y);
> +     dx = abs(dx), dy = abs(dy);
>       /* these are heuristics... */
>          if (dx<=5 && dy<5)
>            return 0;

Thing I have problem with is:
+     dx = abs(dx), dy = abs(dy);
I think it should be rather
+     dx = abs(dx); dy = abs(dy);
What do you think?

Sorry I'm so late, just please take this as an example of that inclusion
into CVS is best impulse for review ;-).

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv hacking
.
  "A common mistake that people make, when trying to design
   something completely foolproof is to underestimate the
   ingenuity of complete fools."
     -- Douglas Adams in Mostly Harmless
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/


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