"Fehler bei "Schlechte Träume""
- fixed curse_active check.
This commit is contained in:
Enno Rehling 2008-03-05 18:39:44 +00:00
parent 8bf96a5726
commit 33da72e28a
4 changed files with 6 additions and 5 deletions

View file

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

View file

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

View file

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

View file

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