Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2003:
[freeciv-ai] Re: New settler code
Home

[freeciv-ai] Re: New settler code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: Freeciv AI development <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Re: New settler code
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sat, 12 Apr 2003 19:12:04 +0100 (BST)

On Sat, 12 Apr 2003, Per I. Mathisen wrote:

> On Fri, 11 Apr 2003, Gregory Berkolaiko wrote:
> > Please give me some info on that.In particular,
> > 1. in aisettler.c
> > } else if (cachemap[map_x][map_y].sum == -1 || !is_city_center(i, j)) {
> >   /* We cannot read city center from cache */
> > Why "!is_city_center(i, j)" ??
> 
> Because city center gives some special benefits that we cannot cache, or
> the cache would become invalid (for when we consider the same tile not as
> a city center).

what I mean is that it should be is_city_center (without the negation),
otherwise you barely ever use cache, isn't it?

and once you have created the previously uncached values, then you check 
for "!is_city_center" before copying them into the cache.

> Ok. Renamed to cityresult.

grand

G.



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