[Freeciv-Dev] (PR#11389) is_valid_city_coords() & hexagonal tiles
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=11389 >
> [jdorje - Tue Dec 07 21:34:23 2004]:
>
> Marko Lindqvist wrote:
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=11389 >
> >
> >
> > As comment in is_valid_city_coords() says:
> > FIXME: this won't work for hexagonal tiles.
>
> FIXME is wrong (outdated). map_vector_to_sq_distance gives the correct
> value for hex topologies.
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.272
diff -u -r1.272 city.c
--- common/city.c 6 Dec 2004 18:01:14 -0000 1.272
+++ common/city.c 8 Dec 2004 01:50:33 -0000
@@ -66,7 +66,8 @@
*
* So CITY_MAP_RADIUS==2 corresponds to the "traditional" city map.
*
- * FIXME: this won't work for hexagonal tiles.
+ * This diagram is for rectangular topologies only. But this is taken
+ * care of inside map_vector_to_sq_distance so it works for all topologies.
*/
return (CITY_MAP_RADIUS * CITY_MAP_RADIUS + 1 >= dist);
}
|
|