]> git.pond.sub.org Git - empserver/commitdiff
(babies): Err, the maxpop case wasn't an optimization... Without
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 11 Oct 2005 20:10:15 +0000 (20:10 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 11 Oct 2005 20:10:15 +0000 (20:10 +0000)
that, we get negative babies, which leads to negative avail and baby
food (cannibalism?) in grow_people().  Restore it.

src/lib/update/human.c

index 075a18ec7b704ddf5efbc9ac40a5e5d9084b2c78..12498972ad6ea84c83ec914557cf569170a2cfb8 100644 (file)
@@ -284,6 +284,9 @@ babies(int adults, int etu, double brate, int food, int maxpop)
 {
     int new_birth, new_food, new;
 
+    if (adults >= maxpop)
+       return 0;
+
     new_birth = roundavg(brate * etu * adults);
     if (opt_NOFOOD)
        new_food = new_birth;