<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40417 >

2008/8/8 Marko Lindqvist:
>
>  This patch makes separatepoles to work again. Land tiles were being
> set as T_UNKNOWN terrain which caused continent numbering to fail
> before poles are added. It seemed like all land tiles are part of
> poles to code making sure that poles are not connected to non-pole
> continents.

 - S2_1 version


 - ML

diff -Nurd -X.diff_ignore freeciv/server/generator/mapgen.c 
freeciv/server/generator/mapgen.c
--- freeciv/server/generator/mapgen.c   2008-07-02 20:24:32.000000000 +0300
+++ freeciv/server/generator/mapgen.c   2008-08-12 01:57:20.000000000 +0300
@@ -376,9 +376,7 @@
     return TRUE;
   }
   adjc_iterate(ptile, tile1) {
-    if (tile1->terrain != T_UNKNOWN
-       && !is_ocean(tile_get_terrain(tile1))
-        && tile_get_continent(tile1) != 0) {
+    if (tile_get_continent(tile1) > 0) {
       return FALSE;
     }
   } adjc_iterate_end;
@@ -1019,6 +1017,9 @@
   if (HAS_POLES) {
     normalize_hmap_poles();
   }
+  /* Pick terrain just once and fill all land tiles with that terrain */
+  struct terrain *land_fill = pick_terrain(MG_LAST, MG_LAST, MG_LAST);
+
   hmap_shore_level = (hmap_max_level * (100 - map.landpercent)) / 100;
   ini_hmap_low_level();
   whole_map_iterate(ptile) {
@@ -1027,6 +1028,10 @@
       int depth = (hmap_shore_level - hmap(ptile)) * 100 / hmap_shore_level;
 
       tile_set_terrain(ptile, pick_ocean(depth));
+    } else {
+      /* Must set some terrain (and not T_UNKNOWN) so continent number
+         assignment works */
+      tile_set_terrain(ptile, land_fill);
     }
   } whole_map_iterate_end;
   if (HAS_POLES) {
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to