diff -ur -Xfreeciv/diff_ignore freeciv-cvs/common/unit.c freeciv/common/unit.c --- freeciv-cvs/common/unit.c Mon Jul 10 04:42:10 2000 +++ freeciv/common/unit.c Mon Jul 31 20:31:18 2000 @@ -469,6 +469,22 @@ /************************************************************************** ... **************************************************************************/ +int is_unit_near_a_friendly_city(struct unit *punit) +{ + int i,j; + struct city * pcity; + + square_iterate (punit->x, punit->y, 3, i,j) + if ((pcity = map_get_city (i, j)) && + (players_allied (punit->owner, pcity->owner))) return 1; + square_iterate_end + + return 0; +} + +/************************************************************************** +... +**************************************************************************/ int is_field_unit(struct unit *punit) { return ((unit_flag(punit->type, F_FIELDUNIT) > 0)); diff -ur -Xfreeciv/diff_ignore freeciv-cvs/common/unit.h freeciv/common/unit.h --- freeciv-cvs/common/unit.h Mon Jul 10 01:48:06 2000 +++ freeciv/common/unit.h Mon Jul 31 20:19:32 2000 @@ -305,6 +305,7 @@ int is_ground_unittype(Unit_Type_id id); int can_unit_build_city(struct unit *punit); int can_unit_add_to_city(struct unit *punit); +int is_unit_near_a_friendly_city(struct unit *punit); int kills_citizen_after_attack(struct unit *punit); struct unit_type *get_unit_type(Unit_Type_id id); diff -ur -Xfreeciv/diff_ignore freeciv-cvs/server/cityturn.c freeciv/server/cityturn.c --- freeciv-cvs/server/cityturn.c Sun Jul 30 12:53:21 2000 +++ freeciv/server/cityturn.c Mon Jul 31 20:22:48 2000 @@ -420,13 +420,9 @@ if (map_get_city(punit->x,punit->y)) return 0; if (is_ground_unit(punit) && - map_get_special(punit->x,punit->y)&S_FORTRESS) { - city_list_iterate(get_player(punit->owner)->cities, pcity) { - if (real_map_distance(punit->x, punit->y, pcity->x, pcity->y)<=3) - return 0; - } - city_list_iterate_end; - } + map_get_special(punit->x,punit->y)&S_FORTRESS) + return !is_unit_near_a_friendly_city (punit); + return 1; } Only in freeciv: toto is a hero