From 1ca7075c09f9a79341c498877a62aaf9b8646a5c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 27 May 2007 20:13:47 +0000 Subject: [PATCH] NEW_MIGRATION define is obsolete --- src/common/gamecode/laws.c | 76 ------------------------------- src/common/settings-eressea.h | 1 - src/common/settings-tutorial.h | 1 - src/common/settings-vinyambar-3.h | 1 - src/common/settings-wdw.h | 1 - 5 files changed, 80 deletions(-) diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 55f916c16..eb778653a 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -419,8 +419,6 @@ live(region * r) * - movement because of low loyalty relating to present parties. */ -#if NEW_MIGRATION == 1 - /* Arbeitsversion */ static void calculate_emigration(region *r) @@ -463,80 +461,6 @@ calculate_emigration(region *r) } } -#else -void -calculate_emigration(region *r) -{ - direction_t i, j; - int maxpeasants_here; - int maxpeasants[MAXDIRECTIONS]; - double wfactor, gfactor; - - /* Vermeidung von DivByZero */ - maxpeasants_here = max(maxworkingpeasants(r),1); - - for (i = 0; i != MAXDIRECTIONS; i++) { - region *c = rconnect(r, i); - if (c && rterrain(c) != T_OCEAN) { - maxpeasants[i] = maxworkingpeasants(c); - } else maxpeasants[i] = 0; - } - - /* calculate emigration for all directions independently */ - - for (i = 0; i != MAXDIRECTIONS; i++) { - region * rc = rconnect(r, i); - if (!rc) continue; - if (fval(r, RF_ORCIFIED)==fval(rc, RF_ORCIFIED)) { - if (fval(rc->terrain, LAND_REGION) && fval(r->terrain, LAND_REGION)) { - int wandering_peasants; - double vfactor; - - /* First let's calculate the peasants who wander off to less inhabited - * regions. wfactor indicates the difference of population denity. - * Never let more than PEASANTSWANDER_WEIGHT per cent wander off in one - * direction. */ - wfactor = ((double) rpeasants(r) / maxpeasants_here - - ((double) rpeasants(rc) / maxpeasants[i])); - wfactor = max(wfactor, 0); - wfactor = min(wfactor, 1); - - /* Now let's handle the greedy peasants. gfactor indicates the - * difference of per-head-wealth. Never let more than - * PEASANTSGREED_WEIGHT per cent wander off in one direction. */ - gfactor = (((double) rmoney(rc) / max(rpeasants(rc), 1)) - - ((double) rmoney(r) / max(rpeasants(r), 1))) / 500; - gfactor = max(gfactor, 0); - gfactor = min(gfactor, 1); - - /* This calculates the influence of volcanos on peasant - * migration. */ - - if(rterrain(rc) == T_VOLCANO || rterrain(rc) == T_VOLCANO_SMOKING) { - vfactor = 0.10; - } else { - vfactor = 1.00; - } - - for(j=0; j != MAXDIRECTIONS; j++) { - region *rv = rconnect(rc, j); - if(rv && (rterrain(rv) == T_VOLCANO || rterrain(rv) == T_VOLCANO_SMOKING)) { - vfactor *= 0.5; - break; - } - } - - wandering_peasants = (int) (rpeasants(r) * (gfactor+wfactor) - * vfactor * PEASANTSWANDER_WEIGHT / 100.0); - - r->land->newpeasants -= wandering_peasants; - rc->land->newpeasants += wandering_peasants; - } - } - } -} -#endif - /** Bauern vermehren sich */ static void diff --git a/src/common/settings-eressea.h b/src/common/settings-eressea.h index e322747cb..3abffb3b4 100644 --- a/src/common/settings-eressea.h +++ b/src/common/settings-eressea.h @@ -21,7 +21,6 @@ #define RESOURCE_QUANTITY 0.5 #define RECRUITFRACTION 40 /* 100/RECRUITFRACTION% */ #define COMBAT_TURNS 5 -#define NEW_MIGRATION 1 #define NEWATSROI 0 /* Vermehrungsrate Bauern in 1/10000. diff --git a/src/common/settings-tutorial.h b/src/common/settings-tutorial.h index 3a24329de..b139df1da 100644 --- a/src/common/settings-tutorial.h +++ b/src/common/settings-tutorial.h @@ -21,7 +21,6 @@ #define RESOURCE_QUANTITY 0.5 #define RECRUITFRACTION 40 /* 100/RECRUITFRACTION% */ #define COMBAT_TURNS 5 -#define NEW_MIGRATION 1 #define NEWATSROI 0 /* Vermehrungsrate Bauern in 1/10000. diff --git a/src/common/settings-vinyambar-3.h b/src/common/settings-vinyambar-3.h index 7fa61d879..d940b32fb 100644 --- a/src/common/settings-vinyambar-3.h +++ b/src/common/settings-vinyambar-3.h @@ -22,7 +22,6 @@ #define RECRUITFRACTION 40 /* 100/RECRUITFRACTION% */ #define NEWATSROI 0 #define COMBAT_TURNS 5 -#define NEW_MIGRATION 1 /* Vermehrungsrate Bauern in 1/10000. * Evt. Berechnungsfehler, reale Vermehrungsraten scheinen höher. */ diff --git a/src/common/settings-wdw.h b/src/common/settings-wdw.h index e74c39086..faed41e90 100644 --- a/src/common/settings-wdw.h +++ b/src/common/settings-wdw.h @@ -21,7 +21,6 @@ #define RESOURCE_QUANTITY 0.5 #define RECRUITFRACTION 40 /* 100/RECRUITFRACTION% */ #define COMBAT_TURNS 5 -#define NEW_MIGRATION 1 /* Vermehrungsrate Bauern in 1/10000. * Evt. Berechnungsfehler, reale Vermehrungsraten scheinen höher. */