From 174a91968b248bc3ba8f9af6fc85d60cb73f9a78 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 22 Sep 2018 08:54:17 +0200 Subject: [PATCH] make herb growth code a little more readable. --- src/laws.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/laws.c b/src/laws.c index 0e9285281..922f4c366 100644 --- a/src/laws.c +++ b/src/laws.c @@ -741,11 +741,13 @@ growing_herbs(region * r, const int current_season, const int last_weeks_season) * Kräuter))% sich zu vermehren. */ UNUSED_ARG(last_weeks_season); if (current_season != SEASON_WINTER) { - int i; - for (i = rherbs(r); i > 0; i--) { - if (rng_int() % 100 < (100 - rherbs(r))) - rsetherbs(r, (short)(rherbs(r) + 1)); + int i, herbs = rherbs(r); + for (i = herbs; i > 0; --i) { + if (rng_int() % 100 < (100 - herbs)) { + ++herbs; + } } + rsetherbs(r, herbs); } }