Index: ai/advdomestic.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/advdomestic.c,v retrieving revision 1.51 diff -u -r1.51 advdomestic.c --- advdomestic.c 1999/09/15 09:09:20 1.51 +++ advdomestic.c 1999/10/06 00:42:16 @@ -221,11 +221,11 @@ int asz = game.aqueduct_size; if (city_happy(pcity) && pcity->size > asz-1 && est_food > 0) values[B_AQUEDUCT] = ((((city_got_effect(pcity, B_GRANARY) ? 3 : 2) * - pcity->size * game.foodbox)/2) - pcity->food_stock) * food; + (pcity->size+1) * game.foodbox)/2) - pcity->food_stock) * food; else { - int tmp = ((asz+1 - MIN(asz, pcity->size)) * MAX(asz, pcity->size) * + int tmp = ((asz+1 - MIN(asz, pcity->size)) * (MAX(asz, pcity->size)+1) * game.foodbox - pcity->food_stock); - values[B_AQUEDUCT] = food * est_food * asz * game.foodbox / MAX(1, tmp); + values[B_AQUEDUCT] = food * est_food * (asz+1) * game.foodbox / MAX(1, tmp); } } @@ -350,11 +350,11 @@ int ssz = game.sewer_size; if (city_happy(pcity) && pcity->size > ssz-1 && est_food > 0) values[B_SEWER] = ((((city_got_effect(pcity, B_GRANARY) ? 3 : 2) * - pcity->size * game.foodbox)/2) - pcity->food_stock) * food; + (pcity->size+1) * game.foodbox)/2) - pcity->food_stock) * food; else { - int tmp = ((ssz+1 - MIN(ssz, pcity->size)) * MAX(ssz, pcity->size) * + int tmp = ((ssz+1 - MIN(ssz, pcity->size)) * (MAX(ssz, pcity->size)+1) * game.foodbox - pcity->food_stock); - values[B_SEWER] = food * est_food * ssz * game.foodbox / MAX(1, tmp); + values[B_SEWER] = food * est_food * (ssz+1) * game.foodbox / MAX(1, tmp); } } Index: ai/aicity.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v retrieving revision 1.57 diff -u -r1.57 aicity.c --- aicity.c 1999/10/04 13:36:14 1.57 +++ aicity.c 1999/10/06 00:42:17 @@ -353,7 +353,7 @@ buycost >= 200) ; /* wait for more vans */ else if (bestchoice.type && unit_flag(bestchoice.choice, F_SETTLERS) && !city_got_effect(pcity, B_GRANARY) && (pcity->size < 2 || - pcity->food_stock < (pcity->size-1) * game.foodbox)) ; + pcity->food_stock < pcity->size * game.foodbox)) ; else if (bestchoice.type && bestchoice.type < 3 && /* not a defender */ buycost > unit_types[bestchoice.choice].build_cost * 2) { /* too expensive */ if (unit_flag(bestchoice.choice, F_CARAVAN) && Index: client/gui-gtk/citydlg.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/citydlg.c,v retrieving revision 1.27 diff -u -r1.27 citydlg.c --- citydlg.c 1999/10/04 11:32:26 1.27 +++ citydlg.c 1999/10/06 00:42:18 @@ -922,7 +922,7 @@ struct city *pcity=pdialog->pcity; sprintf(buf, _("Granary: %3d/%-3d"), pcity->food_stock, - game.foodbox*pcity->size); + game.foodbox*(pcity->size+1)); gtk_set_label(pdialog->storage_label, buf); } Index: client/gui-gtk/cityrep.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/cityrep.c,v retrieving revision 1.17 diff -u -r1.17 cityrep.c --- cityrep.c 1999/09/21 12:44:45 1.17 +++ cityrep.c 1999/10/06 00:42:19 @@ -142,7 +142,7 @@ static char buf[32]; sprintf(buf,"%d/%d", pcity->food_stock, - pcity->size * game.foodbox); + (pcity->size+1) * game.foodbox); return buf; } Index: client/gui-xaw/citydlg.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/citydlg.c,v retrieving revision 1.20 diff -u -r1.20 citydlg.c --- citydlg.c 1999/10/04 11:32:28 1.20 +++ citydlg.c 1999/10/06 00:42:20 @@ -1242,7 +1242,7 @@ _("Granary: %c%3d/%-3d"), (city_got_effect(pcity, B_GRANARY) ? '*' : ' '), pcity->food_stock, - game.foodbox*pcity->size); + game.foodbox*(pcity->size+1)); xaw_set_label(pdialog->storage_label, buf); } Index: client/gui-xaw/cityrep.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/cityrep.c,v retrieving revision 1.17 diff -u -r1.17 cityrep.c --- cityrep.c 1999/10/04 11:32:28 1.17 +++ cityrep.c 1999/10/06 00:42:20 @@ -155,7 +155,7 @@ static char buf[32]; sprintf(buf,"%d/%d", pcity->food_stock, - pcity->size * game.foodbox); + (pcity->size+1) * game.foodbox); return buf; } Index: server/cityturn.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v retrieving revision 1.78 diff -u -r1.78 cityturn.c --- cityturn.c 1999/10/04 13:36:20 1.78 +++ cityturn.c 1999/10/06 00:42:21 @@ -780,7 +780,7 @@ pcity->name, improvement_types[B_AQUEDUCT].name); } /* Granary can only hold so much */ - pcity->food_stock = ((pcity->size) * game.foodbox * + pcity->food_stock = ((pcity->size+1) * game.foodbox * (100 - game.aqueductloss/(1+has_granary))) / 100; return; } @@ -798,14 +798,14 @@ pcity->name, improvement_types[B_SEWER].name); } /* Granary can only hold so much */ - pcity->food_stock = ((pcity->size) * game.foodbox * + pcity->food_stock = ((pcity->size+1) * game.foodbox * (100 - game.aqueductloss/(1+has_granary))) / 100; return; } pcity->size++; if (has_granary) - pcity->food_stock = ((pcity->size) * game.foodbox) / 2; + pcity->food_stock = ((pcity->size+1) * game.foodbox) / 2; else pcity->food_stock = 0; @@ -850,13 +850,13 @@ **************************************************************************/ static void city_reduce_size(struct city *pcity) { - pcity->size--; notify_player_ex(city_owner(pcity), pcity->x, pcity->y, E_CITY_FAMINE, _("Game: Famine feared in %s."), pcity->name); if (city_got_effect(pcity, B_GRANARY)) pcity->food_stock=(pcity->size*game.foodbox)/2; else pcity->food_stock=0; + pcity->size--; city_auto_remove_worker(pcity); } @@ -867,7 +867,7 @@ static void city_populate(struct city *pcity) { pcity->food_stock+=pcity->food_surplus; - if(pcity->food_stock >= pcity->size*game.foodbox) + if(pcity->food_stock >= (pcity->size+1)*game.foodbox) city_increase_size(pcity); else if(pcity->food_stock<0) { unit_list_iterate(pcity->units_supported, punit) { @@ -881,7 +881,7 @@ get_nation_name_plural(game.players[pcity->owner].nation), utname); if (city_got_effect(pcity, B_GRANARY)) - pcity->food_stock=(pcity->size*game.foodbox)/2; + pcity->food_stock=((pcity->size+1)*game.foodbox)/2; else pcity->food_stock=0; return; @@ -1292,13 +1292,13 @@ if (city_refresh(pcity) && g->rapture_size && pcity->size >= g->rapture_size && pcity->food_surplus > 0) { - pcity->food_stock=pcity->size*game.foodbox+1; + pcity->food_stock=(pcity->size+1)*game.foodbox+1; } if (!city_got_effect(pcity,B_GRANARY) && !pcity->is_building_unit && (pcity->currently_building == B_GRANARY) && (pcity->food_surplus > 0) && (pcity->shield_surplus > 0)) { - turns_growth = ((pcity->size * game.foodbox) - pcity->food_stock) + turns_growth = (((pcity->size+1) * game.foodbox) - pcity->food_stock) / pcity->food_surplus; turns_granary = (improvement_value(B_GRANARY) - pcity->shield_stock) / pcity->shield_surplus;