diff --git a/src/laws.c b/src/laws.c index a0c1f22e2..d67d90b18 100644 --- a/src/laws.c +++ b/src/laws.c @@ -325,9 +325,7 @@ static double peasant_luck_factor(void) return config_get_flt("rules.peasants.peasantluck.factor", PEASANTLUCK); } -inline int round_births(double growth) { - return (int)growth; -} +#define ROUND_BIRTHS(growth) ((int)growth) int peasant_luck_effect(int peasants, int luck, int maxp, double variance) { @@ -338,7 +336,7 @@ int peasant_luck_effect(int peasants, int luck, int maxp, double variance) mean *= peasant_luck_factor() * peasant_growth_factor(); mean *= ((peasants / (double)maxp < .9) ? 1 : PEASANTFORCE); - births = round_births(normalvariate(mean, variance * mean)); + births = ROUND_BIRTHS(normalvariate(mean, variance * mean)); if (births <= 0) births = 1; if (births > peasants / 2) @@ -357,7 +355,7 @@ static void peasants(region * r, int rule) if (peasants > 0 && rule > 0) { int luck = 0; double fraction = peasants * peasant_growth_factor(); - int births = round_births(fraction); + int births = ROUND_BIRTHS(fraction); attrib *a = a_find(r->attribs, &at_peasantluck); if (a != NULL) {