Index: advdomestic.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/advdomestic.c,v retrieving revision 1.69 diff -u -r1.69 advdomestic.c --- advdomestic.c 2001/05/23 18:21:23 1.69 +++ advdomestic.c 2001/08/13 02:16:25 @@ -91,13 +91,19 @@ { int i = 0; city_map_iterate(x, y) { - if (map_get_tile(pcity->x+x-2, pcity->y+y-2)->terrain == T_OCEAN) { - i++; /* this is a kluge; wasn't getting enough harbors because -often everyone was stuck farming grassland. */ - if (is_worker_here(pcity, x, y)) i++; + int x1 = pcity->x + x - 2; + int y1 = pcity->y + y - 2; + if (normalize_map_pos(&x1, &y1)) { + if (map_get_tile(x1, y1)->terrain == T_OCEAN) { + i++; + /* this is a kluge; wasn't getting enough harbors because + often everyone was stuck farming grassland. */ + if (is_worker_here(pcity, x, y)) + i++; + } } } city_map_iterate_end; - return(i/2); + return i/2; } static int road_trade(struct city *pcity)