[Freeciv-Dev] (PR#9695) mapgen error / topology 11
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9695 >
LAST CHANGES:
Fix stupid comment
Marcelo
diff -ruN -Xfreeciv/diff_ignore freeciv_/server/mapgen.c freeciv/server/mapgen.c
--- freeciv_/server/mapgen.c 2004-08-17 10:08:45.612758440 +0200
+++ freeciv/server/mapgen.c 2004-08-17 10:09:09.654103600 +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_/server/srv_main.c
freeciv/server/srv_main.c
--- freeciv_/server/srv_main.c 2004-08-17 10:08:45.070840824 +0200
+++ freeciv/server/srv_main.c 2004-08-17 10:11:29.391860232 +0200
@@ -1688,8 +1688,12 @@
map_fractal_generate();
}
- assign_continent_numbers();
-
+ /*
+ * Don't assign continent numbers here. We have to do it later,
+ * because generators 2-4 use their own continent numbering
+ * in create_start_positions(). For other generators continent numbers
+ * are already assigned.
+ */
gamelog_map();
/* start the game */
@@ -1717,6 +1721,9 @@
}
}
+ /* start positions are created, now we can do this safely */
+ assign_continent_numbers();
+
/* Set up alliances based on team selections */
if (game.is_new_game) {
players_iterate(pplayer) {
- [Freeciv-Dev] (PR#9695) mapgen error / topology 11, (continued)
- [Freeciv-Dev] (PR#9695) mapgen error / topology 11, Marcelo Burda, 2004/08/13
- [Freeciv-Dev] (PR#9695) mapgen error / topology 11, Marcelo Burda, 2004/08/13
- [Freeciv-Dev] Re: (PR#9695) mapgen error / topology 11, Jason Short, 2004/08/13
- [Freeciv-Dev] Re: (PR#9695) mapgen error / topology 11, Marcelo Burda, 2004/08/14
- [Freeciv-Dev] (PR#9695) mapgen error / topology 11, Marcelo Burda, 2004/08/14
- [Freeciv-Dev] (PR#9695) mapgen error / topology 11, Marcelo Burda, 2004/08/14
- [Freeciv-Dev] (PR#9695) mapgen error / topology 11, Mateusz Stefek, 2004/08/17
- [Freeciv-Dev] Re: (PR#9695) mapgen error / topology 11, Marcelo Burda, 2004/08/17
- [Freeciv-Dev] Re: (PR#9695) mapgen error / topology 11, Marcelo Burda, 2004/08/17
- [Freeciv-Dev] (PR#9695) mapgen error / topology 11, Mateusz Stefek, 2004/08/17
- [Freeciv-Dev] (PR#9695) mapgen error / topology 11,
Marcelo Burda <=
|
|