diff --git a/src/kernel/curse.c b/src/kernel/curse.c index d018ec117..11f389474 100644 --- a/src/kernel/curse.c +++ b/src/kernel/curse.c @@ -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 */ 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' */ -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 */ /* ------------------------------------------------------------- */ -/* - * 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] = { /* OBS: when removing curses, remember to update read_ccompat() */ diff --git a/src/kernel/curse.h b/src/kernel/curse.h index 817b48ad3..3e2cf3095 100644 --- a/src/kernel/curse.h +++ b/src/kernel/curse.h @@ -286,8 +286,6 @@ extern "C" { void ct_register(const curse_type *); void ct_checknames(void); - curse *cfindhash(int i); - curse *findcurse(int curseid); void curse_init(struct attrib *a); @@ -296,7 +294,6 @@ extern "C" { 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); /* gibt true, wenn der Curse nicht NULL oder inaktiv ist */ diff --git a/src/kernel/unit.c b/src/kernel/unit.c index e5746b11e..1c6553c79 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -1876,7 +1876,6 @@ int newunitid(void) start_random_no = random_unit_no; while (ufindhash(random_unit_no) || dfindhash(random_unit_no) - || cfindhash(random_unit_no) || forbiddenid(random_unit_no)) { random_unit_no++; if (random_unit_no == MAX_UNIT_NR + 1) {