Index: common/city.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/city.c,v retrieving revision 1.99 diff -u -r1.99 city.c --- city.c 2001/01/22 04:57:14 1.99 +++ city.c 2001/02/03 21:10:54 @@ -1223,19 +1223,19 @@ /************************************************************************** ... **************************************************************************/ -int is_unit_near_a_friendly_city(struct unit *punit) +int is_unit_near_an_owned_city(struct unit *punit) { - return is_friendly_city_near(punit->owner, punit->x, punit->y); + return is_owned_city_near(punit->owner, punit->x, punit->y); } /************************************************************************** ... **************************************************************************/ -int is_friendly_city_near(int player_id, int x, int y) +int is_owned_city_near(int player_id, int x, int y) { square_iterate (x, y, 3, x1, y1) { struct city * pcity = map_get_city (x1, y1); - if (pcity && players_allied(player_id, pcity->owner)) + if (pcity && pcity->owner == player_id) return 1; } square_iterate_end; Index: common/city.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/city.h,v retrieving revision 1.74 diff -u -r1.74 city.h --- city.h 2001/01/22 16:19:39 1.74 +++ city.h 2001/02/03 21:10:55 @@ -336,8 +336,8 @@ struct city *is_non_attack_city_tile(struct tile *ptile, int playerid); struct city *is_non_allied_city_tile(struct tile *ptile, int playerid); -int is_unit_near_a_friendly_city(struct unit *punit); -int is_friendly_city_near(int owner, int x, int y); +int is_unit_near_an_owned_city(struct unit *punit); +int is_owned_city_near(int owner, int x, int y); /* granary size as a function of city size */ int city_granary_size(int city_size); Index: server/cityturn.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v retrieving revision 1.138 diff -u -r1.138 cityturn.c --- cityturn.c 2001/02/03 19:45:50 1.138 +++ cityturn.c 2001/02/03 21:10:57 @@ -417,13 +417,15 @@ **************************************************************************/ int unit_being_aggressive(struct unit *punit) { + struct city *pcity; if (get_unit_type(punit->type)->attack_strength==0) return 0; - if (map_get_city(punit->x,punit->y)) + pcity = map_get_city(punit->x, punit->y); + if (pcity && pcity->owner == punit->owner) return 0; if (is_ground_unit(punit) && map_get_special(punit->x,punit->y)&S_FORTRESS) - return !is_unit_near_a_friendly_city (punit); + return !is_unit_near_an_owned_city (punit); return 1; } Index: server/unittools.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v retrieving revision 1.94 diff -u -r1.94 unittools.c --- unittools.c 2001/01/23 10:51:33 1.94 +++ unittools.c 2001/02/03 21:11:02 @@ -2883,7 +2883,7 @@ /* entering/leaving a fortress */ if (map_get_tile(dest_x, dest_y)->special&S_FORTRESS && homecity - && is_friendly_city_near(punit->owner, dest_x, dest_y) + && is_owned_city_near(punit->owner, dest_x, dest_y) && !senthome) { city_refresh(homecity); send_city_info(pplayer, homecity); @@ -2891,7 +2891,7 @@ if (map_get_tile(src_x, src_y)->special&S_FORTRESS && homecity - && is_friendly_city_near(punit->owner, src_x, src_y) + && is_owned_city_near(punit->owner, src_x, src_y) && !senthome) { city_refresh(homecity); send_city_info(pplayer, homecity);