Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9882) Continent and Ocean numbers
Home

[Freeciv-Dev] (PR#9882) Continent and Ocean numbers

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9882) Continent and Ocean numbers
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Tue, 31 Aug 2004 16:49:39 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9882 >

> [glip - Tue Aug 31 23:19:47 2004]:
> 
> On Tue, 31 Aug 2004, Jason Short wrote:
> 
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=9882 >
> > 
> > Why is having separate land/ocean continent accessors better than just 
> > making all continent numbers positive?
In the current code there are checks like this:
if (map_get_continent(punit->x, punit->y) == map_get_continent(pcity->x,
pcity->y)) {...
They assume that the numbers are separate for oceans and continents.
I introduced new function map_is_same_continent() for such problem.
Separate accesors are very helpfull in keeping the code sane. For
example it will find most places, which assume that a city isn't placed
in a ocean. 

> It's not better.  But making them positive (or leaving negative) is 
> essentially indistinguishable with separate accessors.
> 
> However, Mateusz, what do you send to the client and what is client doing
> about it all (in particular what is displayed in the middle-click info)?
> 
ptile->continent
client/text.c also uses ptile->continent directly.
I'm not sure if I should change it.
--
mateusz
> 



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