diff --git a/conf/e3/config.json b/conf/e3/config.json index a6685a06f..3e443c389 100644 --- a/conf/e3/config.json +++ b/conf/e3/config.json @@ -52,7 +52,6 @@ "world.era": 3, "seed.population.min": 8, "seed.population.max": 8, - "rules.migrants.max": 0, "rules.reserve.twophase": true, "rules.owners.force_leave": false, "rules.monsters.attack_chance": 0.1, diff --git a/conf/e4/config.json b/conf/e4/config.json index e407ae21e..654213ede 100644 --- a/conf/e4/config.json +++ b/conf/e4/config.json @@ -51,7 +51,6 @@ "study.speedup": 2, "study.from_use": 0.4, "world.era": 3, - "rules.migrants.max": 0, "rules.reserve.twophase": true, "rules.owners.force_leave": false, "rules.transfermen": false, diff --git a/res/eressea/races.xml b/res/eressea/races.xml index 7f6c6d873..98f00f726 100644 --- a/res/eressea/races.xml +++ b/res/eressea/races.xml @@ -13,6 +13,7 @@ + diff --git a/src/kernel/faction.c b/src/kernel/faction.c index 597e45b30..288c54569 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -756,24 +756,20 @@ int count_migrants(const faction * f) return count_faction(f, COUNT_MIGRANTS); } +#define MIGRANTS_NONE 0 +#define MIGRANTS_LOG10 1 + int count_maxmigrants(const faction * f) { - static int migrants = -1; + int formula = get_param_int(f->race->parameters, "migrants.formula", 0); - if (migrants < 0) { - migrants = config_get_int("rules.migrants.max", INT_MAX); - } - if (migrants == INT_MAX) { - int x = 0; - if (f->race == get_race(RC_HUMAN)) { - int nsize = count_all(f); - if (nsize > 0) { - x = (int)(log10(nsize / 50.0) * 20); - if (x < 0) - x = 0; - } + if (formula == MIGRANTS_LOG10) { + int nsize = count_all(f); + if (nsize > 0) { + int x = (int)(log10(nsize / 50.0) * 20); + if (x < 0) x = 0; + return x; } - return x; } - return migrants; + return 0; }