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.
This commit is contained in:
parent
fc6f1da568
commit
1f9e884525
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue