From 1f9e884525a2e7c0cc75472f3a7ece86b32f57db Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 30 Mar 2008 18:28:07 +0200 Subject: [PATCH] Don't make more babies than food permits babies() rounded the maximum number of babies permitted by food. When this rounded up, grow_people() could use more food than available, and the sector's food could become negative. Fix by always rounding down. --- src/lib/update/human.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/update/human.c b/src/lib/update/human.c index 52806938..1a7b1c5f 100644 --- a/src/lib/update/human.c +++ b/src/lib/update/human.c @@ -273,7 +273,7 @@ babies(int adults, int etu, double brate, int food, int maxpop) if (opt_NOFOOD) new_food = new_birth; else - new_food = (int)(0.5 + food / (2.0 * babyeat)); + new_food = (int)(food / (2.0 * babyeat)); new = new_birth; if (new > new_food)