Bugfix faction==NULL

This commit is contained in:
Enno Rehling 2002-10-13 09:47:03 +00:00
parent aeb249ee6f
commit 7670865a33
2 changed files with 10 additions and 8 deletions

View File

@ -151,8 +151,12 @@ destroy_unit(unit * u)
u->building = clone->building; u->building = clone->building;
u->hp = 1; u->hp = 1;
i = u->no; i = u->no;
uunhash(u);
uunhash(clone);
u->no = clone->no; u->no = clone->no;
clone->no = i; clone->no = i;
uhash(u);
uhash(clone);
set_number(u, 1); set_number(u, 1);
set_spellpoints(u, 0); set_spellpoints(u, 0);
a = a_find(u->attribs, &at_clone); a = a_find(u->attribs, &at_clone);
@ -170,6 +174,8 @@ destroy_unit(unit * u)
scale_number(u, 1); scale_number(u, 1);
u->race = u->irace = new_race[RC_ZOMBIE]; u->race = u->irace = new_race[RC_ZOMBIE];
} else { } else {
if (u->number) set_number(u, 0);
handle_event(&u->attribs, "destroy", u);
if (r && rterrain(r) != T_OCEAN) if (r && rterrain(r) != T_OCEAN)
rsetmoney(r, rmoney(r) + get_money(u)); rsetmoney(r, rmoney(r) + get_money(u));
dhash(u->no, u->faction); dhash(u->no, u->faction);
@ -179,8 +185,6 @@ destroy_unit(unit * u)
if (r) choplist(&r->units, u); if (r) choplist(&r->units, u);
u->next = udestroy; u->next = udestroy;
udestroy = u; udestroy = u;
if (u->number) set_number(u, 0);
handle_event(&u->attribs, "destroy", u);
} }
} }

View File

@ -5287,15 +5287,13 @@
</locale> </locale>
</message> </message>
<message name="entrise"> <message name="entrise" section="events">
<type> <type>
<arg name="region" type="region"></arg> <arg name="region" type="region"></arg>
<arg name="amount" type="int"></arg>
</type> </type>
<locale name="de"> <text locale="de">"In $region($region) erschienen die Herren der Bäume."</text>
<nr section="events"> <text locale="en">"In $region($region), the lords of the trees have risen."</text>
<text>"In $region($region) erschienen die Herren der Bäume."</text>
</nr>
</locale>
</message> </message>
<message name="msg_movement"> <message name="msg_movement">