crashbug dying clone-mages

This commit is contained in:
Enno Rehling 2006-05-21 10:35:08 +00:00
parent 4ea7779932
commit d57e05fcd7
3 changed files with 95 additions and 92 deletions

View File

@ -246,9 +246,9 @@ destroy_unit(unit * u)
set_number(u, 1);
set_spellpoints(u, 0);
a = a_find(u->attribs, &at_clone);
a_remove(&u->attribs, a);
if (a!=NULL) a_remove(&u->attribs, a);
a = a_find(clone->attribs, &at_clonemage);
a_remove(&clone->attribs, a);
if (a!=NULL) a_remove(&clone->attribs, a);
fset(u, UFL_LONGACTION);
set_number(clone, 0);
u = clone;
@ -262,8 +262,9 @@ destroy_unit(unit * u)
} else {
if (u->number) set_number(u, 0);
handle_event(&u->attribs, "destroy", u);
if (r && !fval(r->terrain, SEA_REGION))
if (r && !fval(r->terrain, SEA_REGION)) {
rsetmoney(r, rmoney(r) + get_money(u));
}
dhash(u->no, u->faction);
u_setfaction(u, NULL);
if (r) leave(r, u);

View File

@ -156,6 +156,7 @@ a_unlink(attrib ** pa, attrib * a)
attrib ** pnexttype = pa;
attrib ** pnext = NULL;
assert(a!=NULL);
while (*pnexttype) {
attrib * next = *pnexttype;
if (next->type==a->type) break;
@ -188,6 +189,7 @@ int
a_remove(attrib ** pa, attrib * a)
{
int ok;
assert(a!=NULL);
ok = a_unlink(pa, a);
if (ok) a_free(a);
return ok;

View File

@ -776,7 +776,7 @@
<arg name="ship" type="ship"/>
<arg name="dir" type="direction"/>
</type>
<text locale="de">"Die $region($ship) treibt nach $direction($dir)."</text>
<text locale="de">"Die $ship($ship) treibt nach $direction($dir)."</text>
<text locale="fr">"The ship $ship($ship) drifts to the $direction($dir)."</text>
<text locale="en">"The ship $ship($ship) drifts to the $direction($dir)."</text>
</message>