From d3c670a7c202fcbd674906fe276abd89c5ff7eba Mon Sep 17 00:00:00 2001 From: Katja Zedel Date: Sun, 28 Apr 2002 08:48:12 +0000 Subject: [PATCH] =?UTF-8?q?curse->id=20endlich=20weg!=20=C3=BCbergangsweis?= =?UTF-8?q?e=20steht=20die=20id=20jetzt=20beim=20curse=5Ftyp,=20wird=20an?= =?UTF-8?q?=20zu=20vielen=20stellen=20benutzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/curse.c | 3 +-- src/common/kernel/curse.h | 1 - src/common/kernel/magic.c | 4 ++-- src/common/kernel/save.c | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/common/kernel/curse.c b/src/common/kernel/curse.c index a123ce0f8..50cf4388d 100644 --- a/src/common/kernel/curse.c +++ b/src/common/kernel/curse.c @@ -514,7 +514,6 @@ set_curse(unit *mage, attrib **ap, curse_t id, int id2, int vigour, c = (curse*)a->data.v; c->type = find_cursetype(id); - c->cspellid = id; c->flag = (0); c->vigour = vigour; c->duration = duration; @@ -621,7 +620,7 @@ create_curse(unit *magician, attrib **ap, curse_t id, int id2, int vigour, void do_transfer_curse(curse *c, unit * u, unit * u2, int n) { - curse_t id = c->cspellid; + curse_t id = c->type->cspellid; int id2 = 0; int flag = c->flag; int duration = c->duration; diff --git a/src/common/kernel/curse.h b/src/common/kernel/curse.h index 0a5e967a8..17cdc51aa 100644 --- a/src/common/kernel/curse.h +++ b/src/common/kernel/curse.h @@ -189,7 +189,6 @@ enum { typedef struct curse { struct curse *nexthash; int no; /* 'Einheitennummer' dieses Curse */ - curse_t cspellid; /* Id des Cursezaubers */ struct curse_type * type; /* Zeiger auf ein curse_type-struct */ int flag; /* generelle Flags wie zb CURSE_ISNEW oder CURSE_NOAGE */ int duration; /* Dauer der Verzauberung. Wird jede Runde vermindert */ diff --git a/src/common/kernel/magic.c b/src/common/kernel/magic.c index a0d53eb2e..77d440f50 100644 --- a/src/common/kernel/magic.c +++ b/src/common/kernel/magic.c @@ -1225,7 +1225,7 @@ magic_resistance(unit *target) curse *c = (curse*)a->data.v; unit *mage = c->magician; - if (c->cspellid == C_SONG_GOODMR) { + if (c->type->cspellid == C_SONG_GOODMR) { if (mage != NULL) { if (allied(mage, target->faction, HELP_GUARD)) { chance += c->effect; @@ -1243,7 +1243,7 @@ magic_resistance(unit *target) curse *c = (curse*)a->data.v; unit *mage = c->magician; - if (c->cspellid == C_SONG_BADMR) { + if (c->type->cspellid == C_SONG_BADMR) { if (mage != NULL) { if (allied(mage, target->faction, HELP_GUARD)) { a = a->nexttype; diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index 11c64b4f3..86312b583 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -1406,9 +1406,9 @@ curse_read(attrib * a, FILE * f) { } ct = find_cursetype((curse_t)cspellid); + assert(ct!=NULL); c->type = ct; - c->cspellid = (curse_t)cspellid; /* beim Einlesen sind noch nicht alle units da, muss also * zwischengespeichert werden. */