diff -ruN freeciv.orig/common/game.c freeciv/common/game.c --- freeciv.orig/common/game.c Thu Jun 15 15:45:26 2000 +++ freeciv/common/game.c Thu Jun 15 21:31:13 2000 @@ -757,6 +757,7 @@ game.onsetbarbarian = GAME_DEFAULT_ONSETBARBARIAN; game.nbarbarians = 0; game.occupychance= GAME_DEFAULT_OCCUPYCHANCE; + game.dispersion = GAME_DEFAULT_DISPERSION; game.heating = 0; sz_strlcpy(game.save_name, "civgame"); game.save_nturns=10; diff -ruN freeciv.orig/common/game.h freeciv/common/game.h --- freeciv.orig/common/game.h Thu Jun 15 15:45:23 2000 +++ freeciv/common/game.h Thu Jun 15 20:37:19 2000 @@ -47,6 +47,7 @@ int civstyle; int gold; int settlers, explorer; + int dispersion; int tech; int skill_level; int timeout; @@ -188,13 +189,17 @@ #define GAME_MIN_EXPLORER 0 #define GAME_MAX_EXPLORER 10 +#define GAME_DEFAULT_DISPERSION 0 +#define GAME_MIN_DISPERSION 0 +#define GAME_MAX_DISPERSION 10 + #define GAME_DEFAULT_TECHLEVEL 3 #define GAME_MIN_TECHLEVEL 0 #define GAME_MAX_TECHLEVEL 50 #define GAME_DEFAULT_UNHAPPYSIZE 4 -#define GAME_MIN_UNHAPPYSIZE 1 -#define GAME_MAX_UNHAPPYSIZE 6 +#define GAME_MIN_UNHAPPYSIZE 1 +#define GAME_MAX_UNHAPPYSIZE 6 #define GAME_DEFAULT_END_YEAR 2000 #define GAME_MIN_END_YEAR GAME_START_YEAR diff -ruN freeciv.orig/server/gamehand.c freeciv/server/gamehand.c --- freeciv.orig/server/gamehand.c Thu Jun 15 15:45:26 2000 +++ freeciv/server/gamehand.c Thu Jun 15 22:53:20 2000 @@ -52,7 +52,7 @@ **************************************************************************/ void init_new_game(void) { - int i, j, x, y; + int i, j, x, y, dx, dy; /* dx, dy - dispersed {x,y} */ int start_pos[MAX_NUM_PLAYERS]; /* indices into map.start_positions[] */ if (!map.fixed_start_positions) { @@ -116,24 +116,35 @@ y=map.start_positions[start_pos[i]].y; /* For scenarios, huts may coincide with player starts; remove any such hut: */ - if(map_get_special(x,y)&S_HUT) { - map_clear_special(x,y,S_HUT); - freelog(LOG_VERBOSE, "Removed hut on start position for %s", - game.players[i].name); - } - /* Civ 1 exposes a single square radius of the map to start the game. */ - /* Civ 2 exposes a "city radius". -AJS */ - show_area(&game.players[i], x, y, 1); - if (game.civstyle==2) { - show_area(&game.players[i], x-1, y, 1); - show_area(&game.players[i], x+1, y, 1); - show_area(&game.players[i], x, y-1, 1); - show_area(&game.players[i], x, y+1, 1); + for (j=0;j<(game.settlers+game.explorer);j++) { + /* There are always some good positions in disperse area. + Its center is even warranted to be land */ + do { + dx = x + myrand (2*game.dispersion+1) - game.dispersion; + dy = y + myrand (2*game.dispersion+1) - game.dispersion; + if (dx<0) dx += map.xsize; + if (dy<0) dy += map.ysize; + if (dx>map.xsize) dx -= map.xsize; + if (dy>map.ysize) dy -= map.ysize; + } while (map_get_terrain(dx,dy)==T_OCEAN); + if (map_get_special(dx,dy)&S_HUT) { + map_clear_special(dx,dy,S_HUT); + freelog (LOG_VERBOSE, "Removed hut on start position for %s", + game.players[i].name); + } + + /* Civ 1 exposes a single square radius of the map to start the game. */ + /* Civ 2 exposes a "city radius". -AJS */ + show_area (&game.players[i], dx, dy, 1); + if (game.civstyle==2) { + show_area (&game.players[i], dx-1, dy, 1); + show_area (&game.players[i], dx+1, dy, 1); + show_area (&game.players[i], dx, dy-1, 1); + show_area (&game.players[i], dx, dy+1, 1); + } + create_unit (&game.players[i], dx, dy, + get_role_unit ((j