Merge branch 'master' of github.com:eressea/server

This commit is contained in:
Enno Rehling 2014-10-16 14:33:43 +02:00
commit 27ddeb7adc
4 changed files with 7 additions and 8 deletions

View File

@ -1498,9 +1498,9 @@ bool idle(faction * f)
int maxworkingpeasants(const struct region *r) int maxworkingpeasants(const struct region *r)
{ {
int i = production(r) * MAXPEASANTS_PER_AREA int size = production(r);
- ((rtrees(r, 2) + rtrees(r, 1) / 2) * TREESIZE); int treespace = (rtrees(r, 2) + rtrees(r, 1) / 2) * TREESIZE;
return _max(i, 0); return _max(size-treespace, _min(size / 10 , 200));
} }
int lighthouse_range(const building * b, const faction * f) int lighthouse_range(const building * b, const faction * f)

View File

@ -46,8 +46,7 @@ extern "C" {
# define MAXUNITS 1048573 /* must be prime for hashing. 524287 was >90% full */ # define MAXUNITS 1048573 /* must be prime for hashing. 524287 was >90% full */
#endif #endif
#define MAXPEASANTS_PER_AREA 10 /* number of peasants per region-size */ #define TREESIZE (8) /* space used by trees (in #peasants) */
#define TREESIZE (MAXPEASANTS_PER_AREA-2) /* space used by trees (in #peasants) */
#define PEASANTFORCE 0.75 /* Chance einer Vermehrung trotz 90% Auslastung */ #define PEASANTFORCE 0.75 /* Chance einer Vermehrung trotz 90% Auslastung */
#define HERBROTCHANCE 5 /* Verrottchance für Kräuter (ifdef HERBS_ROT) */ #define HERBROTCHANCE 5 /* Verrottchance für Kräuter (ifdef HERBS_ROT) */

View File

@ -1187,7 +1187,7 @@ void terraform_region(region * r, const terrain_type * terrain)
int production(const region * r) int production(const region * r)
{ {
/* muß rterrain(r) sein, nicht rterrain() wegen rekursion */ /* muß rterrain(r) sein, nicht rterrain() wegen rekursion */
int p = r->terrain->size / MAXPEASANTS_PER_AREA; int p = r->terrain->size;
if (curse_active(get_curse(r->attribs, ct_find("drought")))) if (curse_active(get_curse(r->attribs, ct_find("drought"))))
p /= 2; p /= 2;

View File

@ -267,7 +267,7 @@ static void peasants(region * r)
{ {
int peasants = rpeasants(r); int peasants = rpeasants(r);
int money = rmoney(r); int money = rmoney(r);
int maxp = production(r) * MAXPEASANTS_PER_AREA; int maxp = production(r);
int n, satiated; int n, satiated;
int dead = 0; int dead = 0;
@ -558,7 +558,7 @@ growing_trees(region * r, const int current_season, const int last_weeks_season)
/* Grundchance 1.0% */ /* Grundchance 1.0% */
/* Jeder Elf in der Region erhöht die Chance marginal */ /* Jeder Elf in der Region erhöht die Chance marginal */
elves = _min(elves, (production(r) * MAXPEASANTS_PER_AREA) / 8); elves = _min(elves, production(r) / 8);
if (elves) { if (elves) {
seedchance += 1.0 - pow(0.99999, elves * RESOURCE_QUANTITY); seedchance += 1.0 - pow(0.99999, elves * RESOURCE_QUANTITY);
} }