Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2003:
[Freeciv-Dev] Re: (PR#4331) Bug in cm.c
Home

[Freeciv-Dev] Re: (PR#4331) Bug in cm.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#4331) Bug in cm.c
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 8 Jun 2003 13:09:57 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, 8 Jun 2003, Raimar Falke wrote:
> >From cm3.diff:
>
> +  city_map_iterate(x, y) {
> +    if (result->worker_positions_used[x][y]) {
> +      assert(pcity->city_map[x][y] == C_TILE_EMPTY
> +           || pcity->city_map[x][y] == C_TILE_WORKER);
> +    }
> +  } city_map_iterate_end;
>
> This is obviously incorrect as it doesn't handle unreal map
> position. So use city_map_checked_iterate or my_city_map_iterate
> (which leaves out the center). Was this the problem/error?!

Yes. I guess my question is: Shouldn't the unreal tiles be set to a value
which does not produce erronous core dumps? ie set them to C_TILE_EMPTY.
From my reading of cm.c, this is what the original, default value is, but
it gets set to C_TILE_UNAVAILABLE for some reason. That is wrong, let it
core when you try to _use_ the unreal position - that you way you can see
what the problem is instead of blaming CM.

  - Per




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