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: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4331) Bug in cm.c
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Tue, 10 Jun 2003 09:37:21 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, Jun 08, 2003 at 01:09:57PM -0700, Per I. Mathisen wrote:
> 
> 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.

If we speak about pcity->city_map than unreal tiles should be
C_TILE_UNAVAILABLE. This value is used to indicate unreal positions
and blocked tiles (enemy units on the tile or used by another city).

This usage is just copied in pcombination->worker_positions with
tighter rules (you have to see the tile).

I'm not sure if I have answered your question.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "SIGDANGER - The System is likely to crash soon"




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