This code fixes the crash Freeciv has generating maps less than 18 units (360 miles?) high. Note that the practical lower limit seems to be a 12x12 map. FreeCiv does really weird things with smaller maps. Also note that the client is really buggy with narrow maps; the client assumes that a given element is only seen once on the screen. - Sam --- freeciv-1.14.0/server/mapgen.c.orig Sun Mar 23 02:45:43 2003 +++ freeciv-1.14.0/server/mapgen.c Sun Mar 23 03:05:44 2003 @@ -261,13 +261,23 @@ while (i > 0 && j < 500) { j++; - y=myrand(map.ysize*10/180)+map.ysize*110/180; + if(map.ysize >= 18) { + y=myrand(map.ysize*10/180)+map.ysize*110/180; + } + else { + y = map.ysize*110/180; + } x=myrand(map.xsize); if (map_get_terrain(x, y)==T_GRASSLAND) { make_desert(x,y, hmap(x, y), 50); i--; } - y=myrand(map.ysize*10/180)+map.ysize*60/180; + if(map.ysize >= 18) { + y=myrand(map.ysize*10/180)+map.ysize*60/180; + } + else { + y = map.ysize*60/180; + } x=myrand(map.xsize); if (map_get_terrain(x, y)==T_GRASSLAND) { make_desert(x,y, hmap(x, y), 50);