Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)
Home

[Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Dec 2001 13:54:11 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Fri, Dec 14, 2001 at 11:55:37AM +0000, Gregory Berkolaiko wrote:
>  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> > On Thu, Dec 13, 2001 at 06:10:33PM +0000, Gregory Berkolaiko wrote:
> > > No "default" warmap is a jump too big for now.
> > > There is a lot of confusion in the code now, with functions
> > generating
> > > warmap being few calls away from the functions using it etc.
> > 
> > To help you I have changed your patch. It now tracks an id of the
> > generator. Note that 3 autogames have run without a message and there
> > was also no message during a quick interactive testing. However this
> 
> Very interesting experiment.
> There are, however, easy explanations to the observed irregularities:

> Mea culpa.  I should not use direct access to warmap.

You can catch these if you remove the global variable.

> 5000:
> =================
>   if (*ferryboat)
>     generate_warmap(NULL, punit->x, punit->y, *ferryboat,5000);
> 
>   generate_warmap(NULL, punit->x, punit->y, punit,5001);
> =================
> You see, first call generates sea-map.  

> Second call generates land-map and _overwrites_ the id of the
> sea-map.

And know it is ugly but not _this_ ugly.

> Both are used later, but sea-map thinks that it's id is 5001
> 
> My biggest worry is that in find_boat a wrong map is sometimes used.  It
> seems that sometimes find_boat looks for a transport closest to the
> home-town of the unit, not caring whether the unit is there or miles
> away.
> 
> But using warmap for finding boat is conceptually complicated: you have
> to take into account both unit's current position and it's destination.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Your mail could not be delivered to the following Address:
  VTCMC.VTLPR@xxxxxxxxxxxxx        ** Unassigned error message **"


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