Index: ai/advdomestic.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/advdomestic.c,v retrieving revision 1.36 diff -u -r1.36 advdomestic.c --- advdomestic.c 1999/04/25 02:30:41 1.36 +++ advdomestic.c 1999/05/07 19:09:52 @@ -219,7 +219,7 @@ 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)>>1) - pcity->food_stock) * food; + (pcity->size+1) * game.foodbox)>>1) - pcity->food_stock) * food; else values[B_AQUEDUCT] = food * est_food * asz * game.foodbox / MAX(1, ((asz+1 - MIN(asz, pcity->size)) * MAX(asz, pcity->size) * game.foodbox - pcity->food_stock)); @@ -343,7 +343,7 @@ 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)>>1) - pcity->food_stock) * food; + (pcity->size+1) * game.foodbox)>>1) - pcity->food_stock) * food; else values[B_SEWER] = food * est_food * ssz * game.foodbox / MAX(1, ((ssz+1 - MIN(ssz, pcity->size)) * MAX(ssz, pcity->size) * game.foodbox - pcity->food_stock)); Index: ai/aicity.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v retrieving revision 1.40 diff -u -r1.40 aicity.c --- aicity.c 1999/04/25 02:30:43 1.40 +++ aicity.c 1999/05/07 19:09:53 @@ -340,7 +340,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+1) * 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: ai/aihand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aihand.c,v retrieving revision 1.32 diff -u -r1.32 aihand.c --- aihand.c 1999/04/25 02:30:44 1.32 +++ aihand.c 1999/05/07 19:09:53 @@ -273,7 +273,7 @@ n = (((pcity->size + 1)>>1) - pcity->ppl_happy[4]) * 20; if (n > pcity->ppl_content[1] * 20) n += (n - pcity->ppl_content[1] * 20); m = ((((city_got_effect(pcity, B_GRANARY) ? 3 : 2) * - pcity->size * game.foodbox)>>1) - + (pcity->size+1) * game.foodbox)>>1) - pcity->food_stock) * food_weighting(pcity->size); if(0) freelog(LOG_DEBUG, "Checking HHJJ for %s, m = %d", pcity->name, m); tot = 0; Index: client/gui-gtk/citydlg.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/citydlg.c,v retrieving revision 1.4 diff -u -r1.4 citydlg.c --- citydlg.c 1999/05/04 11:25:03 1.4 +++ citydlg.c 1999/05/07 19:09:54 @@ -879,7 +879,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.2 diff -u -r1.2 cityrep.c --- cityrep.c 1999/04/26 09:27:30 1.2 +++ cityrep.c 1999/05/07 19:09:54 @@ -135,7 +135,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.5 diff -u -r1.5 citydlg.c --- citydlg.c 1999/05/04 11:25:03 1.5 +++ citydlg.c 1999/05/07 19:09:55 @@ -983,7 +983,7 @@ struct city *pcity=pdialog->pcity; sprintf(buf, "Granary: %3d/%-3d", 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.4 diff -u -r1.4 cityrep.c --- cityrep.c 1999/04/26 09:27:38 1.4 +++ cityrep.c 1999/05/07 19:09:55 @@ -144,7 +144,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.54 diff -u -r1.54 cityturn.c --- cityturn.c 1999/05/03 20:46:58 1.54 +++ cityturn.c 1999/05/07 19:09:56 @@ -764,7 +764,7 @@ pcity->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; } @@ -781,14 +781,14 @@ pcity->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; @@ -826,13 +826,13 @@ **************************************************************************/ 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); } @@ -843,7 +843,7 @@ 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) { @@ -855,7 +855,7 @@ gamelog(GAMELOG_UNITFS, "%s lose Settlers (famine)", get_race_name_plural(game.players[pcity->owner].race)); 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; @@ -1250,13 +1250,13 @@ if (city_refresh(pcity) && get_government(pcity->owner)>=G_REPUBLIC && pcity->food_surplus>0 && pcity->size>4) { - 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;