diff -ruN -Xdiff_ignore freeciv_cvs/server/cityturn.c freeciv/server/cityturn.c --- freeciv_cvs/server/cityturn.c Wed Jan 24 16:39:15 2001 +++ freeciv/server/cityturn.c Wed Jan 24 17:27:26 2001 @@ -1276,7 +1276,8 @@ struct government *g = get_gov_pplayer(pplayer); int space_part; int city_built_city_builder; - + int production_overflow; + while (pcity->shield_surplus<0) { unit_list_iterate(pcity->units_supported, punit) { if (utype_shield_cost(get_unit_type(punit->type), g)) { @@ -1290,7 +1291,18 @@ unit_list_iterate_end; } - pcity->shield_stock+=pcity->shield_surplus; + if (!pcity->is_building_unit && + pcity->shield_stock > improvement_value (pcity->currently_building)) + production_overflow = pcity->shield_stock - + improvement_value (pcity->currently_building); + else if (pcity->is_building_unit && + pcity->shield_stock > unit_value (pcity->currently_building)) + production_overflow = pcity->shield_stock - + unit_value (pcity->currently_building); + else + production_overflow = 0; + + pcity->shield_stock+=pcity->shield_surplus; if (!pcity->is_building_unit) { if (pcity->currently_building==B_CAPITAL) { pplayer->economic.gold+=pcity->shield_surplus; @@ -1441,7 +1453,11 @@ } } -return 1; + + if (pcity->turn_last_built == game.year && production_overflow) + pcity->shield_stock -= (production_overflow + 1) / 2; + + return 1; } /**************************************************************************