curse->id endlich weg!

übergangsweise steht die id jetzt beim curse_typ, wird an zu vielen stellen
benutzt
This commit is contained in:
Katja Zedel 2002-04-28 08:48:12 +00:00
parent e559f123d4
commit d3c670a7c2
4 changed files with 4 additions and 6 deletions

View File

@ -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;

View File

@ -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 */

View File

@ -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;

View File

@ -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. */