Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9695) mapgen error / topology 11
Home

[Freeciv-Dev] (PR#9695) mapgen error / topology 11

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#9695) mapgen error / topology 11
From: "Marcelo Burda" <mburda@xxxxxxxxx>
Date: Sat, 14 Aug 2004 02:21:46 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [mburda - Sam. Aoû. 14 09:18:48 2004]:
> 
> Fixed:
> Marcelo
> 
get this file (i delete a unneeded assert)
diff -ruN -Xfreeciv/diff_ignore freeciv.back/server/mapgen.c 
freeciv/server/mapgen.c
--- freeciv.back/server/mapgen.c        2004-08-13 21:08:52.000000000 +0200
+++ freeciv/server/mapgen.c     2004-08-14 09:21:28.963329576 +0200
@@ -1164,6 +1164,8 @@
   make_plains();
   make_fair();
   make_rivers();
+
+  assign_continent_numbers();
 }
 
 /**************************************************************************
@@ -1472,15 +1474,15 @@
 {
   int x, y, k, sum;
   struct start_filter_data data;
-
+  
   if (!islands) {
     /* Isle data is already setup for generators 2, 3, and 4. */
     setup_isledata();
   }
 
-  data.count = 0;
   data.dist = MIN(40, MIN(map.xsize / 2, map.ysize / 2));
 
+  data.count = 0;
   sum = 0;
   for (k = 1; k <= map.num_continents; k++) {
     sum += islands[k].starters;
@@ -1502,16 +1504,14 @@
       freelog(LOG_DEBUG, "Adding %d,%d as starting position %d.",
              x, y, data.count);
       data.count++;
+
     } else {
       data.dist--;
       if (data.dist == 0) {
-       char filename[] = "map_core.sav";
-
-       save_game(filename);
        die(_("The server appears to have gotten into an infinite loop "
              "in the allocation of starting positions, and will abort.\n"
-             "The map has been saved into %s.\n"
-             "Please report this bug at %s."), filename, WEBSITE_URL);
+             "Maybe the numbers of players/ia is too much for this map.\n"
+             "Please report this bug at %s."), WEBSITE_URL);
       }
     }
   }
@@ -1653,6 +1653,8 @@
     if (!map.tinyisles) {
       remove_tiny_islands();
     }
+  } else {
+      assign_continent_numbers();
   }
 
   if(!map.have_specials) /* some scenarios already provide specials */
@@ -2225,7 +2227,7 @@
     /* this only runs to initialise static things, not to actually
      * create an island. */
     balance = 0;
-    pstate->isleindex = 3;     /* 0= none, 1= arctic, 2= antarctic */
+    pstate->isleindex = map.num_continents + 1;        /* 0= none, poles, then 
isles */
 
     checkmass = pstate->totalmass;
 
@@ -2272,7 +2274,7 @@
       return FALSE;
     }
     islands[pstate->isleindex].starters = starters;
-
+    assert(starters>=0);
     freelog(LOG_VERBOSE, "island %i", pstate->isleindex);
 
     /* keep trying to place an island, and decrease the size of
@@ -2332,6 +2334,7 @@
 **************************************************************************/
 static void initworld(struct gen234_state *pstate)
 {
+  int i;
   height_map = fc_malloc(sizeof(int) * map.ysize * map.xsize);
   islands = fc_malloc((MAP_NCONT+1)*sizeof(struct isledata));
 
@@ -2348,9 +2351,9 @@
     assign_continent_numbers(); 
   }
   make_island(0, 0, pstate, 0);
-  islands[2].starters = 0;
-  islands[1].starters = 0;
-  islands[0].starters = 0;
+  for(i = 0; i <= map.num_continents; i++ ) {
+      islands[i].starters = 0;
+  }
 }  
 
 /* This variable is the Default Minimum Specific Island Size, 
diff -ruN -Xfreeciv/diff_ignore freeciv.back/server/srv_main.c 
freeciv/server/srv_main.c
--- freeciv.back/server/srv_main.c      2004-08-13 21:08:52.000000000 +0200
+++ freeciv/server/srv_main.c   2004-08-14 09:03:50.346263832 +0200
@@ -1688,8 +1688,6 @@
     map_fractal_generate();
   }
 
-  assign_continent_numbers();
-
   gamelog_map();
   /* start the game */
 
@@ -1717,6 +1715,9 @@
     }
   }
 
+  assign_continent_numbers();
+  /*  never reassing number befor create start pos gen 2-4 */
+
   /* Set up alliances based on team selections */
   if (game.is_new_game) {
    players_iterate(pplayer) {

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