diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index a6f354e1c..a9a54e80a 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -544,19 +544,21 @@ peasants(region * r) } for (n = peasants; n; n--) { - int i; + int chances = 1; - if (glueck >= 0) { /* Sonst keine Vermehrung */ + if (glueck>0) { + --glueck; + chances += PEASANTLUCK; + } + + while (chances--) { if (rand() % 10000 < PEASANTGROWTH) { - if (peasants/(float)maxp < 0.9 || rand() % 100 < PEASANTFORCE) { + /* First chance always goes through. Next ones only with 75% chance if + * peasants have reached 90% of maxpopulation */ + if (chances==0 || peasants/(float)maxp < 0.9 || chance(PEASANTFORCE)) { ++peasants; } } - --glueck; - } - - for (i=0; i!=PEASANTLUCK; i++) { - if (rand() % 10000 < PEASANTGROWTH) ++peasants; } } diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index 589940d08..7ecbce42c 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -234,7 +234,7 @@ extern void read_laen(struct region * r, int laen); #define DMRISEHAFEN 20 /* Vermehrung trotz 90% Auslastung */ -#define PEASANTFORCE 75 +#define PEASANTFORCE 0.75 #define PEASANTSWANDER_WEIGHT 5 #define PEASANTSGREED_WEIGHT 5