From 33da72e28a8a0baae94f0924cd6a02eb4101158b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 5 Mar 2008 18:39:44 +0000 Subject: [PATCH] =?UTF-8?q?http://eressea.upb.de/mantis/view.php=3Fid=3D13?= =?UTF-8?q?08=20"Fehler=20bei=20"Schlechte=20Tr=C3=A4ume""=20-=20fixed=20c?= =?UTF-8?q?urse=5Factive=20check.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/battle.c | 2 +- src/common/kernel/curse.c | 5 +++-- src/common/kernel/curse.h | 2 +- src/common/kernel/unit.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 7f2152b01..4750095d3 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -3703,7 +3703,7 @@ init_battle(region * r, battle **bp) boolean calm = false; while (a && a->type==&at_curse) { curse * c = (curse *)a->data.v; - if (c->type==calm_ct && c->effect.i==u2->faction->subscription) { + if (c->type==calm_ct && curse_geteffect(c)==u2->faction->subscription) { if (curse_active(c)) { calm = true; break; diff --git a/src/common/kernel/curse.c b/src/common/kernel/curse.c index c1b3376e1..266e9754c 100644 --- a/src/common/kernel/curse.c +++ b/src/common/kernel/curse.c @@ -418,8 +418,9 @@ curse_changevigour(attrib **ap, curse *c, double vigour) int curse_geteffect(const curse *c) { - if (c) return c->effect.i; - return 0; + if (c==NULL) return 0; + if (c_flags(c) & CURSE_ISNEW) return 0; + return c->effect.i; } /* ------------------------------------------------------------- */ diff --git a/src/common/kernel/curse.h b/src/common/kernel/curse.h index 1dbf3f3e9..8c104928e 100644 --- a/src/common/kernel/curse.h +++ b/src/common/kernel/curse.h @@ -189,7 +189,7 @@ typedef struct curse { struct curse *nexthash; int no; /* 'Einheitennummer' dieses Curse */ const struct curse_type * type; /* Zeiger auf ein curse_type-struct */ - unsigned int flags; /* generelle Flags wie zb CURSE_ISNEW oder CURSE_NOAGE */ + unsigned int flags; /* WARNING: these are XORed with type->flags! */ int duration; /* Dauer der Verzauberung. Wird jede Runde vermindert */ double vigour; /* Stärke der Verzauberung, Widerstand gegen Antimagie */ struct unit *magician; /* Pointer auf den Magier, der den Spruch gewirkt hat */ diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index c6ebdedf4..586e18b90 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -1118,7 +1118,7 @@ att_modification(const unit *u, skill_t sk) a = a_find(u->region->attribs, &at_curse); while (a && a->type==&at_curse) { curse * c = (curse*)a->data.v; - if (c->type==gbdream_ct) { + if (curse_active(c) && c->type==gbdream_ct) { int mod = curse_geteffect(c); unit * mage = c->magician; /* wir suchen jeweils den größten Bonus und den größten Malus */