Fix update's resupply of food to avoid starvation

do_feed() used supply_commod() incorrectly, which wiped out all food
in the starving sector.
This commit is contained in:
Markus Armbruster 2008-03-14 20:01:23 +01:00
parent f89edc7ae6
commit 03811b2c97

View file

@ -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,
vec[I_FOOD] += supply_commod(sp->sct_own,
sp->sct_x, sp->sct_y,
I_FOOD, needed);
I_FOOD, needed - vec[I_FOOD]);
}
}
starved = feed_people(vec, etu);