Index: client/citydlg_common.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/citydlg_common.c,v retrieving revision 1.6 diff -u -r1.6 citydlg_common.c --- client/citydlg_common.c 2002/03/14 20:41:10 1.6 +++ client/citydlg_common.c 2002/06/30 16:04:33 @@ -121,7 +121,7 @@ if (!pcity->is_building_unit && pcity->currently_building == B_CAPITAL) { my_snprintf(buffer, buffer_len, _("%3d gold per turn"), - pcity->shield_surplus); + MAX(0, pcity->shield_surplus)); } else { char time[50]; @@ -161,9 +161,8 @@ struct city *pcity) { if (!is_unit && id == B_CAPITAL) { - my_snprintf(buffer, buffer_len, - "%s (XX) %d/turn", - get_impr_name_ex(pcity, id), pcity->shield_surplus); + my_snprintf(buffer, buffer_len, "%s (XX) %d/turn", + get_impr_name_ex(pcity, id), MAX(0, pcity->shield_surplus)); } else { int turns = city_turns_to_build(pcity, id, is_unit, TRUE); char *name; @@ -246,7 +245,8 @@ /* Add the turns-to-build entry in the 4th position */ if (pcity) { if (!is_unit && id == B_CAPITAL) { - my_snprintf(buf[3], column_size, "%d/turn", pcity->shield_surplus); + my_snprintf(buf[3], column_size, "%d/turn", + MAX(0, pcity->shield_surplus)); } else { int turns = city_turns_to_build(pcity, id, is_unit, FALSE); if (turns < 999) { Index: client/cityrepdata.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/cityrepdata.c,v retrieving revision 1.18 diff -u -r1.18 cityrepdata.c --- client/cityrepdata.c 2002/03/17 10:48:49 1.18 +++ client/cityrepdata.c 2002/06/30 16:04:33 @@ -148,7 +148,7 @@ if (!pcity->is_building_unit && pcity->currently_building == B_CAPITAL) { my_snprintf(buf, sizeof(buf), "%s (%d/X/X/X)%s", get_impr_name_ex(pcity, pcity->currently_building), - pcity->shield_stock, from_worklist); + MAX(0, pcity->shield_surplus), from_worklist); } else { int turns = city_turns_to_build(pcity, pcity->currently_building, pcity->is_building_unit, TRUE); Index: client/repodlgs_common.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/repodlgs_common.c,v retrieving revision 1.2 diff -u -r1.2 repodlgs_common.c --- client/repodlgs_common.c 2002/06/27 00:59:12 1.2 +++ client/repodlgs_common.c 2002/06/30 16:04:33 @@ -59,7 +59,7 @@ city_list_iterate(game.player_ptr->cities, pcity) { *total_income += pcity->tax_total; if (!pcity->is_building_unit && pcity->currently_building == B_CAPITAL) { - *total_income += pcity->shield_surplus; + *total_income += MAX(0, pcity->shield_surplus); } } city_list_iterate_end; } Index: server/cityturn.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v retrieving revision 1.191 diff -u -r1.191 cityturn.c --- server/cityturn.c 2002/06/09 15:10:13 1.191 +++ server/cityturn.c 2002/06/30 16:04:35 @@ -905,6 +905,7 @@ bool space_part; if (pcity->currently_building == B_CAPITAL) { + assert(pcity->shield_surplus >= 0); pplayer->economic.gold += pcity->shield_surplus; pcity->before_change_shields = 0; pcity->shield_stock = 0;