Merge pull request #36 from CTD1/Workingplace

Arbeitsplätze

It's weird. It worked on this PR, probably because it is based on a revision of master where the .travis.yml file already exists. For older PRs that were created before that file was in master, it doesn't work. We don't have many open ones, so it's not actually worth investigating how to fix that :-)
This commit is contained in:
Enno Rehling 2014-10-16 14:05:49 +02:00
commit c6b6883477
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 i = production(r) * MAXPEASANTS_PER_AREA
- ((rtrees(r, 2) + rtrees(r, 1) / 2) * TREESIZE);
return _max(i, 0);
int size = production(r);
int treespace = (rtrees(r, 2) + rtrees(r, 1) / 2) * TREESIZE;
return _max(size-treespace, _min(size / 10 , 200));
}
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 */
#endif
#define MAXPEASANTS_PER_AREA 10 /* number of peasants per region-size */
#define TREESIZE (MAXPEASANTS_PER_AREA-2) /* space used by trees (in #peasants) */
#define TREESIZE (8) /* space used by trees (in #peasants) */
#define PEASANTFORCE 0.75 /* Chance einer Vermehrung trotz 90% Auslastung */
#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)
{
/* 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"))))
p /= 2;

View File

@ -267,7 +267,7 @@ static void peasants(region * r)
{
int peasants = rpeasants(r);
int money = rmoney(r);
int maxp = production(r) * MAXPEASANTS_PER_AREA;
int maxp = production(r);
int n, satiated;
int dead = 0;
@ -558,7 +558,7 @@ growing_trees(region * r, const int current_season, const int last_weeks_season)
/* Grundchance 1.0% */
/* 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) {
seedchance += 1.0 - pow(0.99999, elves * RESOURCE_QUANTITY);
}