forked from github/server
C90 has no inline keyword
This commit is contained in:
parent
a9ca16e767
commit
b9a20bb378
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue