From 03811b2c97d9537cfeaf4e5a6726002b0b0d6b78 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 14 Mar 2008 20:01:23 +0100 Subject: [PATCH] Fix update's resupply of food to avoid starvation do_feed() used supply_commod() incorrectly, which wiped out all food in the starving sector. --- src/lib/update/human.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/update/human.c b/src/lib/update/human.c index 52806938..38c648d4 100644 --- a/src/lib/update/human.c +++ b/src/lib/update/human.c @@ -82,9 +82,9 @@ do_feed(struct sctstr *sp, struct natstr *np, short *vec, if (vec[I_FOOD] < needed && sp->sct_own == sp->sct_oldown) { /* steal food from warehouses, headquarters, supply ships in port, or supply units */ - vec[I_FOOD] = supply_commod(sp->sct_own, - sp->sct_x, sp->sct_y, - I_FOOD, needed); + vec[I_FOOD] += supply_commod(sp->sct_own, + sp->sct_x, sp->sct_y, + I_FOOD, needed - vec[I_FOOD]); } } starved = feed_people(vec, etu);