cfindhash is gone

This commit is contained in:
Enno Rehling 2016-03-25 21:51:49 +01:00
parent 75f2be75d8
commit 98a3b31953
3 changed files with 6 additions and 42 deletions

View File

@ -98,16 +98,6 @@ static void cunhash(curse * c)
} }
} }
curse *cfindhash(int i)
{
curse *old;
for (old = cursehash[i % MAXENTITYHASH]; old; old = old->nexthash)
if (old->no == i)
return old;
return NULL;
}
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* at_curse */ /* at_curse */
void curse_init(attrib * a) void curse_init(attrib * a)
@ -389,9 +379,13 @@ curse *get_curse(attrib * ap, const curse_type * ctype)
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* findet einen curse global anhand seiner 'curse-Einheitnummer' */ /* findet einen curse global anhand seiner 'curse-Einheitnummer' */
curse *findcurse(int cid) curse *findcurse(int i)
{ {
return cfindhash(cid); curse *old;
for (old = cursehash[i % MAXENTITYHASH]; old; old = old->nexthash)
if (old->no == i)
return old;
return NULL;
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
@ -700,32 +694,6 @@ bool is_cursed_with(const attrib * ap, const curse * c)
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* cursedata */ /* cursedata */
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/*
* typedef struct curse_type {
* const char *cname; (Name der Zauberwirkung, Identifizierung des curse)
* int typ;
* spread_t spread;
* unsigned int mergeflags;
* int (*curseinfo)(const struct locale*, const void*, int, curse*, int);
* void (*change_vigour)(curse*, double);
* int (*read)(struct storage * store, curse * c);
* int (*write)(struct storage * store, const curse * c);
* } curse_type;
*/
int resolve_curse(variant id, void *address)
{
int result = 0;
curse *c = NULL;
if (id.i != 0) {
c = cfindhash(id.i);
if (c == NULL) {
result = -1;
}
}
*(curse **)address = c;
return result;
}
static const char *oldnames[MAXCURSE] = { static const char *oldnames[MAXCURSE] = {
/* OBS: when removing curses, remember to update read_ccompat() */ /* OBS: when removing curses, remember to update read_ccompat() */

View File

@ -286,8 +286,6 @@ extern "C" {
void ct_register(const curse_type *); void ct_register(const curse_type *);
void ct_checknames(void); void ct_checknames(void);
curse *cfindhash(int i);
curse *findcurse(int curseid); curse *findcurse(int curseid);
void curse_init(struct attrib *a); void curse_init(struct attrib *a);
@ -296,7 +294,6 @@ extern "C" {
double destr_curse(struct curse *c, int cast_level, double force); double destr_curse(struct curse *c, int cast_level, double force);
int resolve_curse(variant data, void *address);
bool is_cursed_with(const struct attrib *ap, const struct curse *c); bool is_cursed_with(const struct attrib *ap, const struct curse *c);
/* gibt true, wenn der Curse nicht NULL oder inaktiv ist */ /* gibt true, wenn der Curse nicht NULL oder inaktiv ist */

View File

@ -1876,7 +1876,6 @@ int newunitid(void)
start_random_no = random_unit_no; start_random_no = random_unit_no;
while (ufindhash(random_unit_no) || dfindhash(random_unit_no) while (ufindhash(random_unit_no) || dfindhash(random_unit_no)
|| cfindhash(random_unit_no)
|| forbiddenid(random_unit_no)) { || forbiddenid(random_unit_no)) {
random_unit_no++; random_unit_no++;
if (random_unit_no == MAX_UNIT_NR + 1) { if (random_unit_no == MAX_UNIT_NR + 1) {