"Todeswolke läßt sich nicht bannen"

bugfix conversion of old attributes
This commit is contained in:
Enno Rehling 2006-07-28 13:27:34 +00:00
parent ff262fdb59
commit 37143411e1
1 changed files with 6 additions and 5 deletions

View File

@ -3187,15 +3187,15 @@ dc_age(struct curse * c)
/* age returns 0 if the attribute needs to be removed, !=0 otherwise */ /* age returns 0 if the attribute needs to be removed, !=0 otherwise */
{ {
region * r = (region*)c->data.v; region * r = (region*)c->data.v;
unit ** up = &r->units; unit *u, **up;
unit * mage = c->magician; unit * mage = c->magician;
unit * u;
if (mage==NULL || mage->number==0) { if (r==NULL || mage==NULL || mage->number==0) {
/* if the mage disappears, so does the spell. */ /* if the mage disappears, so does the spell. */
return 0; return -1;
} }
up = &r->units;
if (curse_active(c)) while (*up!=NULL) { if (curse_active(c)) while (*up!=NULL) {
unit * u = *up; unit * u = *up;
double damage = c->effect.f * u->number; double damage = c->effect.f * u->number;
@ -3269,6 +3269,7 @@ dc_read_compat(struct attrib * a, FILE* F)
effect.f = (float)strength; effect.f = (float)strength;
c = create_curse(u, &r->attribs, &ct_deathcloud, strength * 2, duration, effect, 0); c = create_curse(u, &r->attribs, &ct_deathcloud, strength * 2, duration, effect, 0);
c->data.v = r;
if (u==NULL) { if (u==NULL) {
ur_add(var, (void**)&c->magician, resolve_unit); ur_add(var, (void**)&c->magician, resolve_unit);
} }