diff -Nur -X/data/freeciv-dev/freeciv/diff_ignore freeciv/common/map.c codeciv/common/map.c --- freeciv/common/map.c Wed Jan 24 19:43:57 2001 +++ codeciv/common/map.c Wed Jan 24 22:43:29 2001 @@ -1061,7 +1061,8 @@ ***************************************************************/ void map_set_continent(int x, int y, int val) { - (map.tiles + map_adjust_x(x) + y * map.xsize)->continent=val; + assert(normalize_map_pos(&x, &y)); + (map.tiles + map_adjust_x(x) + y * map.xsize)->continent=val; } diff -Nur -X/data/freeciv-dev/freeciv/diff_ignore freeciv/server/mapgen.c codeciv/server/mapgen.c --- freeciv/server/mapgen.c Wed Jan 24 19:44:05 2001 +++ codeciv/server/mapgen.c Wed Jan 24 22:42:08 2001 @@ -1571,22 +1571,33 @@ int x, y, xo, yo, i=0; yo = myrand(map.ysize)+n-s; xo = myrand(map.xsize)+w-e; - y = n + s / 2; - x = w + e / 2; /* this helps a lot for maps with high landmass */ - for (y = n, x = w ; y < s && x < e ; y++, x++) - if (hmap(x, y) && is_coastline(x + xo - w, y + yo - n)) + for (y = n, x = w ; y < s && x < e ; y++, x++) { + int map_x = x + xo - w; + int map_y = y + yo - n; + if (!normalize_map_pos(&map_x, &map_y)) return 0; + if (hmap(x, y) && is_coastline(map_x, map_y)) + return 0; + } for (y = n ; y < s ; y++) - for (x = w ; x < e ; x++) - if (hmap(x, y) && is_coastline(x + xo - w, y + yo - n)) - return 0; + for (x = w ; x < e ; x++) { + int map_x = x + xo - w; + int map_y = y + yo - n; + if (!normalize_map_pos(&map_x, &map_y)) + return 0; + if (hmap(x, y) && is_coastline(map_x, map_y)) + return 0; + } for (y = n ; y < s ; y++) for (x = w ; x < e ; x++) { if (hmap(x, y)) { + int map_x = x + xo - w; + int map_y = y + yo - n; + assert(normalize_map_pos(&map_x, &map_y)); checkmass--; if(checkmass<=0) { @@ -1594,8 +1605,8 @@ return i; } - map_set_terrain(xo + x - w, yo + y - n, T_GRASSLAND); - map_set_continent(xo + x - w, yo + y - n, isleindex); + map_set_terrain(map_x, map_y, T_GRASSLAND); + map_set_continent(map_x, map_y, isleindex); i++; } }