diff --git a/src/kernel/config.c b/src/kernel/config.c index 0137bcf60..9aa30958e 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -1152,11 +1152,6 @@ char *_strdup(const char *s) } #endif -bool faction_id_is_unused(int id) -{ - return findfaction(id) == NULL; -} - int besieged(const unit * u) { /* belagert kann man in schiffen und burgen werden */ diff --git a/src/kernel/config.h b/src/kernel/config.h index 4550ae687..2308409d6 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -27,25 +27,11 @@ extern "C" { #include "types.h" struct param; - /* for some good prime numbers, check http://www.math.niu.edu/~rusin/known-math/98/pi_x */ -#ifndef MAXREGIONS -# define MAXREGIONS 524287 /* must be prime for hashing. 262139 was a little small */ -#endif -#ifndef MAXUNITS -# define MAXUNITS 1048573 /* must be prime for hashing. 524287 was >90% full */ -#endif -#define MAXLUXURIES 16 /* there must be no more than MAXLUXURIES kinds of luxury goods in any game */ - /* getunit results: */ #define GET_UNIT 0 #define GET_NOTFOUND 1 #define GET_PEASANTS 2 - /** - * Hier endet der Teil von config.h, der die defines für die - * Spielwelt Eressea enthält, und beginnen die allgemeinen Routinen - */ - #define DISPLAYSIZE 8192 /* max. Länge einer Beschreibung, incl trailing 0 */ #define ORDERSIZE (DISPLAYSIZE*2) /* max. length of an order */ #define NAMESIZE 128 /* max. Länge eines Namens, incl trailing 0 */ @@ -64,9 +50,6 @@ struct param; #define fset(u, i) ((u)->flags |= (i)) #define freset(u, i) ((u)->flags &= ~(i)) - /* parteinummern */ - bool faction_id_is_unused(int); - int max_magicians(const struct faction * f); int findoption(const char *s, const struct locale *lang); diff --git a/src/kernel/faction.c b/src/kernel/faction.c index 71286cffe..28d50ff76 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -208,6 +208,11 @@ int resolve_faction(variant id, void *address) return result; } +bool faction_id_is_unused(int id) +{ + return findfaction(id) == NULL; +} + #define MAX_FACTION_ID (36*36*36*36) static int unused_faction_id(void) diff --git a/src/kernel/faction.h b/src/kernel/faction.h index 2dbce4c86..16b26c5f9 100644 --- a/src/kernel/faction.h +++ b/src/kernel/faction.h @@ -160,6 +160,7 @@ extern "C" { /* skills */ int skill_limit(struct faction *f, skill_t sk); int count_skill(struct faction *f, skill_t sk); + bool faction_id_is_unused(int); #ifdef __cplusplus } diff --git a/src/kernel/region.h b/src/kernel/region.h index b0672e758..e955a7439 100644 --- a/src/kernel/region.h +++ b/src/kernel/region.h @@ -26,6 +26,9 @@ extern "C" { #include "types.h" #include "direction.h" +#define MAXLUXURIES 16 /* there must be no more than MAXLUXURIES kinds of luxury goods in any game */ +#define MAXREGIONS 524287 /* must be prime for hashing. 262139 was a little small */ + /* FAST_CONNECT: regions are directly connected to neighbours, saves doing a hash-access each time a neighbour is needed, 6 extra pointers per hex */ #define FAST_CONNECT diff --git a/src/kernel/unit.h b/src/kernel/unit.h index 89fb90d9b..7f8cca095 100644 --- a/src/kernel/unit.h +++ b/src/kernel/unit.h @@ -26,6 +26,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. extern "C" { #endif +#define MAXUNITS 1048573 /* must be prime for hashing. 524287 was >90% full */ struct skill; struct item; struct sc_mage;