]> git.pond.sub.org Git - empserver/commit
(food_needed): New.
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 26 May 2006 18:22:42 +0000 (18:22 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 26 May 2006 18:22:42 +0000 (18:22 +0000)
commit109dad1bee93a3770a6b914a0d9a11733b68bfd0
tree1b162f10a79b4b34c6b23d9e2c95f4d4c77e9436
parent0ac31b3ece484a8b487d6067b003b4cd87a34da7
(food_needed): New.
(feed_ship, feed_land): Use it.
(do_feed): Use it.  Estimate of food needed was one too large for
integer food needs.  Used to round fractional food need to nearest
instead of up for supply_commod(), which could cause starvation.
(s_commod, get_minimum): Use it.  Estimate of food needed was one too
large for integer food needs.  s_commod() used to reserve one more
than get_minimum() would have returned; it's now the same.

(famine_victims): New.
(feed_people): Use it.  This rounds victim fractions down instead of
up.  It also dosn't flush needs <=1 to zero.  Doesn't change
starvation, as do_feed() always produces at least one emergency food.
Does change food consumption.

(starve_some): New.
(feed_people): Use it.

(feed_ship): Use feed_people().  This rounds victim fractions down
instead of up.

(feed_land): Use feed_people().  Rounding of victim fractions
unchanged.  Feeds all people not just mil; closes #913997.

(starv_people): New.
(starv_sects, starv_ships, starv_units): Use it.  Fixes starve land to
talk about people instead of mil.

(starv_sects): Use famine_victims() rather than feed_people().  Take
emergency food into account, because feed_people() doesn't.  Don't aim
for one extra food, for consistency with starv_ships() and
starv_units().
(feed_people): Remove useless parameter.  Simplify.

(starv_ships, starv_ships): Use famine_victims() rather than
feed_ship() and feed_land().
(feed_ship, feed_land): Remove useless parameters.  Internal linkage.
Simplify.

(feed_land): Call resupply_commod() only if there's a food shortage.
Don't scrounge lnd_ship for food, resupply_commod() already does.
include/prototypes.h
src/lib/commands/strv.c
src/lib/subs/supply.c
src/lib/update/human.c
src/lib/update/land.c
src/lib/update/ship.c