diff -ur freeciv/server/settlers.c aiset2/server/settlers.c --- freeciv/server/settlers.c Mon Mar 6 23:08:41 2000 +++ aiset2/server/settlers.c Fri Mar 10 02:11:44 2000 @@ -48,6 +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 +1044,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*/ +{ + if (map_get_city(x-1,y+2)) return 0; + if (map_get_city(x, y+2)) return 0; + if (map_get_city(x+1,y+2)) return 0; + + if (map_get_city(x-2,y+1)) return 0; + if (map_get_city(x-1,y+1)) return 0; + if (map_get_city(x, y+1)) return 0; + if (map_get_city(x+1,y+1)) return 0; + if (map_get_city(x+2,y+1)) return 0; + if (map_get_city(x-2,y+1)) return 0; + if (map_get_city(x-2,y+1)) return 0; + + if (map_get_city(x-2,y)) return 0; + if (map_get_city(x-1,y)) return 0; +/*if (map_get_city(x, y)) return 0; need to be able to ad to city*/ + if (map_get_city(x+1,y)) return 0; + if (map_get_city(x+2,y)) return 0; + + if (map_get_city(x-2,y-1)) return 0; + if (map_get_city(x-1,y-1)) return 0; + if (map_get_city(x, y-1)) return 0; + if (map_get_city(x+1,y-1)) return 0; + if (map_get_city(x+2,y-1)) return 0; + if (map_get_city(x-2,y-1)) return 0; + if (map_get_city(x-2,y-1)) return 0; + + if (map_get_city(x-1,y-2)) return 0; + if (map_get_city(x, y-2)) return 0; + if (map_get_city(x+1,y-2)) return 0; + + return 0; }