Index: ai/aihand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aihand.c,v retrieving revision 1.80 diff -u -r1.80 aihand.c --- ai/aihand.c 10 May 2003 18:11:25 -0000 1.80 +++ ai/aihand.c 11 May 2003 21:45:36 -0000 @@ -357,7 +357,7 @@ * this is a rather big CPU operation, we'd rather not. */ check_player_government_rates(pplayer); city_list_iterate(pplayer->cities, acity) { - generic_city_refresh(acity, TRUE); + generic_city_refresh(acity, TRUE, NULL); auto_arrange_workers(acity); if (ai_fix_unhappy(acity)) { ai_scientists_taxmen(acity); Index: common/city.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/city.c,v retrieving revision 1.187 diff -u -r1.187 city.c --- common/city.c 6 May 2003 05:18:49 -0000 1.187 +++ common/city.c 11 May 2003 21:45:37 -0000 @@ -46,7 +46,9 @@ static void unhappy_city_check(struct city *pcity); static void set_pollution(struct city *pcity); static void set_food_trade_shields(struct city *pcity); -static void city_support(struct city *pcity); +static void city_support(struct city *pcity, + void (*send_unit_info) (struct player *pplayer, + struct unit *punit)); /* end helper functions for generic_city_refresh */ static int improvement_upkeep_asmiths(struct city *pcity, Impr_Type_id i, @@ -70,9 +72,6 @@ struct citystyle *city_styles = NULL; -/* from server/unittools.h */ -void send_unit_info(struct player *dest, struct unit *punit); - /************************************************************************** ... **************************************************************************/ @@ -1941,7 +1940,9 @@ /************************************************************************** ... **************************************************************************/ -static void city_support(struct city *pcity) +static void city_support(struct city *pcity, + void (*send_unit_info) (struct player *pplayer, + struct unit *punit)) { struct government *g = get_gov_pcity(pcity); @@ -2063,10 +2064,11 @@ } /* Send unit info if anything has changed */ - if ((this_unit->unhappiness != old_unhappiness - || this_unit->upkeep != old_upkeep - || this_unit->upkeep_food != old_upkeep_food - || this_unit->upkeep_gold != old_upkeep_gold) && is_server) { + if (send_unit_info + && (this_unit->unhappiness != old_unhappiness + || this_unit->upkeep != old_upkeep + || this_unit->upkeep_food != old_upkeep_food + || this_unit->upkeep_gold != old_upkeep_gold)) { send_unit_info(unit_owner(this_unit), this_unit); } } @@ -2077,7 +2079,9 @@ ... **************************************************************************/ void generic_city_refresh(struct city *pcity, - bool refresh_trade_route_cities) + bool refresh_trade_route_cities, + void (*send_unit_info) (struct player *pplayer, + struct unit *punit)) { int prev_tile_trade = pcity->tile_trade; @@ -2088,7 +2092,7 @@ set_pollution(pcity); citizen_happy_luxury(pcity); /* with our new found luxuries */ citizen_happy_buildings(pcity); /* temple cathedral colosseum */ - city_support(pcity); /* manage settlers, and units */ + city_support(pcity, send_unit_info); /* manage settlers, and units */ citizen_happy_wonders(pcity); /* happy wonders & fundamentalism */ unhappy_city_check(pcity); @@ -2099,7 +2103,7 @@ struct city *pcity2 = find_city_by_id(pcity->trade[i]); if (pcity2) { - generic_city_refresh(pcity2, FALSE); + generic_city_refresh(pcity2, FALSE, send_unit_info); } } } Index: common/city.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/city.h,v retrieving revision 1.128 diff -u -r1.128 city.h --- common/city.h 8 May 2003 03:06:58 -0000 1.128 +++ common/city.h 11 May 2003 21:45:37 -0000 @@ -436,7 +436,9 @@ /* city update functions */ void generic_city_refresh(struct city *pcity, - bool refresh_trade_route_cities); + bool refresh_trade_route_cities, + void (*send_unit_info) (struct player *pplayer, + struct unit *punit)); void adjust_city_free_cost(int *num_free, int *this_cost); int city_corruption(struct city *pcity, int trade); int city_waste(struct city *pcity, int shields); Index: common/aicore/cm.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/aicore/cm.c,v retrieving revision 1.7 diff -u -r1.7 cm.c --- common/aicore/cm.c 17 Apr 2003 15:51:07 -0000 1.7 +++ common/aicore/cm.c 11 May 2003 21:45:38 -0000 @@ -614,7 +614,7 @@ pcity->ppl_taxman = result->taxmen; /* Do a local recalculation of the city */ - generic_city_refresh(pcity, FALSE); + generic_city_refresh(pcity, FALSE, NULL); copy_stats(pcity, result); Index: server/cityturn.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v retrieving revision 1.211 diff -u -r1.211 cityturn.c --- server/cityturn.c 6 May 2003 05:18:49 -0000 1.211 +++ server/cityturn.c 11 May 2003 21:45:38 -0000 @@ -85,7 +85,7 @@ **************************************************************************/ void city_refresh(struct city *pcity) { - generic_city_refresh(pcity, TRUE); + generic_city_refresh(pcity, TRUE, send_unit_info); /* AI would calculate this 1000 times otherwise; better to do it once -- Syela */ pcity->ai.trade_want =