[Freeciv-Dev] (PR#10000) PATCH: avoid too small inland ocean
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] (PR#10000) PATCH: avoid too small inland ocean |
From: |
"Marcelo Burda" <mburda@xxxxxxxxx> |
Date: |
Thu, 9 Sep 2004 14:57:49 -0700 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10000 >
> [mburda - Jeu. Sep. 09 21:47:43 2004]:
>
> This patch ovoid too small oceans as 1-2 tiles for small maps
> Marcelo
>
Ups! i forget the patch ;-)
Marcelo
Les fichiers freeciv/manual/civmanual et freeciv_/manual/civmanual sont
différents.
diff -ruN -Xfreeciv/diff_ignore freeciv/server/mapgen.c freeciv_/server/mapgen.c
--- freeciv/server/mapgen.c 2004-09-09 21:09:42.038782872 +0200
+++ freeciv_/server/mapgen.c 2004-09-09 21:58:19.991186680 +0200
@@ -108,6 +108,14 @@
/* An estimate of the linear (1-dimensional) size of the map. */
#define SQSIZE MAX(1, sqrt(map.xsize * map.ysize / 1000))
+
+/*************************************************************************
+ lacs less than SMALL_LAC are avoided
+ for a size 1 map lacs of 3 tiles are not deleted
+ for huges maps this value is map.num_valid_dirs
+*************************************************************************/
+#define SMALL_LAC MIN(map.num_valid_dirs - 1, SQSIZE + 2)
+
/*
* these are base units to define distances
*/
@@ -1334,6 +1342,16 @@
renormalize_hmap_poles();
make_polar_land(); /* make extra land at poles*/
}
+ /* avoid too small oceans */
+ assign_continent_numbers(); /* count sizes */
+ whole_map_iterate(x, y) {
+ int nr = map_get_continent(x,y);
+ if (is_ocean(map_get_terrain(x, y)) &&
+ get_ocean_size(-nr) < SMALL_LAC) {
+ map_set_terrain(x, y, T_UNKNOWN);
+ map_unset_placed(x, y);
+ }
+ } whole_map_iterate_end;
make_relief(); /* base relief on map */
make_arctic();
make_terrains(); /* place forest/desert/swamp/grass/tundra and plains */
|
|