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 01:58:29 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [mstefek - Tue Aug 31 08:40:32 2004]:
> 
> Here's my proposition
> 
> There will be two functions:
> int map_get_continent_number(int x, int y)
> int map_get_ocean_number(int x, int y)
> 
> They will return Continent_id value in range
> [1..map.num_continents/map.num_oceans]
> 
> If map_get_continent_number is called with ocean tile it will triger an
> assertion.
> 
> Continent numbers will be stored in tile.continent as they are now
> (oceans with negative values). Only common/map.c and server/maphand.c
> and packet code will be allowed to use it directly.
> 
> --
> mateusz

I would also add map_is_same_continent(int x, int y, int x2, int y2)

There are bugs in improvements code like this:
void city_add_improvement(struct city *pcity, Impr_Type_id impr)
{
  struct player *pplayer = city_owner(pcity);

  if (improvement_obsolete(pplayer, impr)) {
    mark_improvement(pcity, impr, I_OBSOLETE);
  } else {
    mark_improvement(pcity, impr, I_ACTIVE);
  }

  improvements_update_redundant(pplayer, pcity, 
                                map_get_continent(pcity->x, pcity->y),
                                improvement_types[impr].equiv_range);
}

This doesn't work with ocean cities. (I'm not touching it in this ticket)
--
mateusz


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