diff -r -u freeciv/server/settlers.c smart_settlers/server/settlers.c --- freeciv/server/settlers.c Mon Mar 6 23:08:41 2000 +++ smart_settlers/server/settlers.c Wed Mar 8 14:20:25 2000 @@ -48,7 +48,7 @@ static int is_already_assigned(struct unit *myunit, struct player *pplayer, int x, int y); - +int adjacent_city_exists(int x, int y); /************************************************************************** ... **************************************************************************/ @@ -1043,7 +1043,8 @@ && map_get_terrain(x, y) != T_OCEAN && (territory[x][y]&(1<ai.founder_want = want; } +} + +int adjacent_city_exists(int x, int y) /*little local helper function*/ +{ + int xitr, yitr; + for (xitr = x-2; xitr <= x+2; xitr++) + for (yitr = y-2; yitr <= y+2; yitr++) + if (!(xitr == x && yitr == y)) + if (map_get_city(xitr,yitr)) + return 1; + return 0; }