From 37143411e1b586126378b8a7e3cb1b8797115b77 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 28 Jul 2006 13:27:34 +0000 Subject: [PATCH] =?UTF-8?q?http://eressea.upb.de/mantis/view.php=3Fid=3D68?= =?UTF-8?q?1=20"Todeswolke=20l=C3=A4=C3=9Ft=20sich=20nicht=20bannen"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bugfix conversion of old attributes --- src/common/spells/spells.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/spells/spells.c b/src/common/spells/spells.c index 4536f28cc..2ca49b5dc 100644 --- a/src/common/spells/spells.c +++ b/src/common/spells/spells.c @@ -3187,15 +3187,15 @@ dc_age(struct curse * c) /* age returns 0 if the attribute needs to be removed, !=0 otherwise */ { region * r = (region*)c->data.v; - unit ** up = &r->units; + unit *u, **up; 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. */ - return 0; + return -1; } + up = &r->units; if (curse_active(c)) while (*up!=NULL) { unit * u = *up; double damage = c->effect.f * u->number; @@ -3269,6 +3269,7 @@ dc_read_compat(struct attrib * a, FILE* F) effect.f = (float)strength; c = create_curse(u, &r->attribs, &ct_deathcloud, strength * 2, duration, effect, 0); + c->data.v = r; if (u==NULL) { ur_add(var, (void**)&c->magician, resolve_unit); }