Vereinfachung des Bauerncodes.

This commit is contained in:
Enno Rehling 2006-01-07 12:30:25 +00:00
parent 68389e2ba6
commit 5b5026cefd
2 changed files with 11 additions and 9 deletions

View File

@ -544,19 +544,21 @@ peasants(region * r)
} }
for (n = peasants; n; n--) { 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 (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; ++peasants;
} }
} }
--glueck;
}
for (i=0; i!=PEASANTLUCK; i++) {
if (rand() % 10000 < PEASANTGROWTH) ++peasants;
} }
} }

View File

@ -234,7 +234,7 @@ extern void read_laen(struct region * r, int laen);
#define DMRISEHAFEN 20 #define DMRISEHAFEN 20
/* Vermehrung trotz 90% Auslastung */ /* Vermehrung trotz 90% Auslastung */
#define PEASANTFORCE 75 #define PEASANTFORCE 0.75
#define PEASANTSWANDER_WEIGHT 5 #define PEASANTSWANDER_WEIGHT 5
#define PEASANTSGREED_WEIGHT 5 #define PEASANTSGREED_WEIGHT 5