--- ../../freeciv/common/map.h Wed May 24 15:13:01 2000 +++ map.h Thu Jun 8 00:07:16 2000 @@ -355,6 +355,6 @@ #define MAP_DEFAULT_GENERATOR 1 #define MAP_MIN_GENERATOR 1 -#define MAP_MAX_GENERATOR 4 +#define MAP_MAX_GENERATOR 5 #endif /* FC__MAP_H */ --- ../../freeciv/server/mapgen.c Mon Jan 31 12:04:36 2000 +++ mapgen.c Thu Jun 8 00:08:17 2000 @@ -29,6 +29,7 @@ #include "shared.h" #include "mapgen.h" +#include "planetgen.h" #define hmap(x,y) &height_map[(y)*map.xsize+map_adjust_x(x)] @@ -38,6 +39,7 @@ static void mapgenerator2(void); static void mapgenerator3(void); static void mapgenerator4(void); +static void mapgenerator5(void); static void smooth_map(void); static void adjust_map(int minval); @@ -799,6 +801,8 @@ map_allocate(); /* if one mapgenerator fails, it will choose another mapgenerator */ /* with a lower number to try again */ + if (map.generator == 5 ) + mapgenerator5(); if (map.generator == 4 ) mapgenerator4(); if (map.generator == 3 ) @@ -1597,3 +1601,60 @@ freelog(LOG_VERBOSE, "%ld mass left unplaced", checkmass); } } + + + +/************************************************************************ + mapgenerator5 : This generates planets across the map. Sure, it looks + like lots of little islands but I call them planets. + - CAW +************************************************************************/ +static void mapgenerator5(void) +{ + int numberplanets; + char *cwmap; + int i,j; + time_t t; + + time(&t); +/* srandom((unsigned int)t); */ + + + /* from generatemap1 */ + height_map=fc_malloc (sizeof(int)*map.xsize*map.ysize); + + adjust_terrain_param(); + + numberplanets = determine_number_planets(map.xsize,map.ysize, + map.landpercent); + + cwmap = (char*) fc_malloc(sizeof(char)*map.xsize*map.ysize); + for(i=0;i<(map.ysize*map.xsize);i++) cwmap[i] = ' '; + /* --- init and clear the map */ + + map.num_start_positions = game.nplayers; + place_planets_on_map(map.xsize,map.ysize,cwmap,numberplanets); + + generate_planets(map.xsize,map.ysize,cwmap); + + for(i=0;i