version 1.34 | | version 1.35 |
---|
| | |
/* | | /* |
* static char *rcsid_arch_c = | | * static char *rcsid_arch_c = |
* "$Id: arch.c,v 1.34 2005/10/28 19:08:53 akirschbaum Exp $"; | | * "$Id: arch.c,v 1.35 2005/12/05 23:34:03 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* Then the blocksview[] array is initialised. | | * Then the blocksview[] array is initialised. |
*/ | | */ |
| | |
void init_archetypes() { /* called from add_player() and edit() */ | | void init_archetypes(void) { /* called from add_player() and edit() */ |
if(first_archetype!=NULL) /* Only do this once */ | | if(first_archetype!=NULL) /* Only do this once */ |
return; | | return; |
arch_init = 1; | | arch_init = 1; |
| | |
* Initialise the hashtable used by the archetypes. | | * Initialise the hashtable used by the archetypes. |
*/ | | */ |
| | |
void clear_archetable() { | | void clear_archetable(void) { |
memset((void *) arch_table,0,ARCHTABLE*sizeof(archetype *)); | | memset((void *) arch_table,0,ARCHTABLE*sizeof(archetype *)); |
} | | } |
| | |
| | |
* An alternative way to init the hashtable which is slower, but _works_... | | * An alternative way to init the hashtable which is slower, but _works_... |
*/ | | */ |
| | |
void init_archetable() { | | void init_archetable(void) { |
archetype *at; | | archetype *at; |
LOG(llevDebug," Setting up archetable..."); | | LOG(llevDebug," Setting up archetable..."); |
for(at=first_archetype;at!=NULL;at=(at->more==NULL)?at->next:at->more) | | for(at=first_archetype;at!=NULL;at=(at->more==NULL)?at->next:at->more) |
| | |
* this with the O key. | | * this with the O key. |
*/ | | */ |
| | |
void dump_all_archetypes() { | | void dump_all_archetypes(void) { |
archetype *at; | | archetype *at; |
for(at=first_archetype;at!=NULL;at=(at->more==NULL)?at->next:at->more) { | | for(at=first_archetype;at!=NULL;at=(at->more==NULL)?at->next:at->more) { |
dump_arch(at); | | dump_arch(at); |
| | |
} | | } |
} | | } |
| | |
void free_all_archs() | | void free_all_archs(void) |
{ | | { |
archetype *at, *next; | | archetype *at, *next; |
int i=0,f=0; | | int i=0,f=0; |
| | |
* Allocates, initialises and returns the pointer to an archetype structure. | | * Allocates, initialises and returns the pointer to an archetype structure. |
*/ | | */ |
| | |
archetype *get_archetype_struct() { | | archetype *get_archetype_struct(void) { |
archetype *new; | | archetype *new; |
| | |
new=(archetype *)CALLOC(1,sizeof(archetype)); | | new=(archetype *)CALLOC(1,sizeof(archetype)); |
| | |
} | | } |
| | |
#ifdef DEBUG | | #ifdef DEBUG |
void check_generators() { | | void check_generators(void) { |
archetype *at; | | archetype *at; |
for(at=first_archetype;at!=NULL;at=at->next) | | for(at=first_archetype;at!=NULL;at=at->next) |
if(QUERY_FLAG(&at->clone,FLAG_GENERATOR)&&at->clone.other_arch==NULL) | | if(QUERY_FLAG(&at->clone,FLAG_GENERATOR)&&at->clone.other_arch==NULL) |
| | |
* Then initialises treasures by calling load_treasures(). | | * Then initialises treasures by calling load_treasures(). |
*/ | | */ |
| | |
void load_archetypes() { | | void load_archetypes(void) { |
FILE *fp; | | FILE *fp; |
char filename[MAX_BUF]; | | char filename[MAX_BUF]; |
int comp; | | int comp; |