forked from github/server
make herb growth code a little more readable.
This commit is contained in:
parent
e46826a89c
commit
174a91968b
1 changed files with 6 additions and 4 deletions
10
src/laws.c
10
src/laws.c
|
@ -741,12 +741,14 @@ growing_herbs(region * r, const int current_season, const int last_weeks_season)
|
||||||
* Kräuter))% sich zu vermehren. */
|
* Kräuter))% sich zu vermehren. */
|
||||||
UNUSED_ARG(last_weeks_season);
|
UNUSED_ARG(last_weeks_season);
|
||||||
if (current_season != SEASON_WINTER) {
|
if (current_season != SEASON_WINTER) {
|
||||||
int i;
|
int i, herbs = rherbs(r);
|
||||||
for (i = rherbs(r); i > 0; i--) {
|
for (i = herbs; i > 0; --i) {
|
||||||
if (rng_int() % 100 < (100 - rherbs(r)))
|
if (rng_int() % 100 < (100 - herbs)) {
|
||||||
rsetherbs(r, (short)(rherbs(r) + 1));
|
++herbs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rsetherbs(r, herbs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void immigration(void)
|
void immigration(void)
|
||||||
|
|
Loading…
Reference in a new issue