Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Logical operator inversion in citytools.c (PR#913)
Home

[Freeciv-Dev] Re: Logical operator inversion in citytools.c (PR#913)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rwetmore@xxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Logical operator inversion in citytools.c (PR#913)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 26 Aug 2001 08:53:36 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Aug 25, 2001 at 10:06:59PM -0700, rwetmore@xxxxxxxxxxxx wrote:
> Full_Name: Ross Wetmore
> Version: cvs-Aug-25
> Distribution: Don't know
> Client: Both (or N/A)
> OS: RedHat Linux 7.0
> Submission from: (NULL) (65.92.47.30)
> 
> 
> Logical operator inversion causes cartesian rather than centre square to
> be checked for food. Problem if city is polar, or near non-wrap border.
> 
> Cheers,
> RossW
> =====
> Suggested fix:
> 
> --- ../.freeciv-Aug-25/server/citytools.c   Sat Aug 25 07:56:32 2001
> +++ server/citytools.c  Sun Aug 26 00:54:51 2001
> @@ -217,7 +217,7 @@
>  {
>    int best = 0, tmp;
>    city_map_iterate(x, y) {
> -    if ((x == 2 || y == 2) ||
> +    if ((x == 2 && y == 2) ||
>     (get_worker_city(pcity, x, y) == C_TILE_WORKER) ||
>     can_place_worker_here(pcity, x, y)) {
>        tmp = city_tile_value(pcity, x, y, 0, 0);

Very nice. This is the kind of errors we hoped to catch. Applied. This
and some further grepping conviced me that a "is_city_center" would be
a good method.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "The Internet is really just a series of bottlenecks 
  joined by high speed networks."
    -- Sam Wilson


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