- leave no child behind (rounding error in peasants)
This commit is contained in:
Enno Rehling 2006-05-22 20:27:55 +00:00
parent d6397d6edb
commit 52ac81707b
1 changed files with 6 additions and 1 deletions

View File

@ -553,9 +553,14 @@ peasants(region * r)
if (peasants>0) {
int glueck = 0;
int births = (int)(0.5F + peasants * 0.0001F * PEASANTGROWTH);
double fraction = peasants * 0.0001F * PEASANTGROWTH;
int births = (int)fraction;
attrib * a = a_find(r->attribs, &at_peasantluck);
if (rng_double()<(fraction-births)) {
/* because we don't want regions that never grow pga. rounding. */
++births;
}
if (a!=NULL) {
glueck = a->data.i * 1000;
}