crashfix for calling destroy_unit on a unit that has already been destroyed.

This commit is contained in:
Enno Rehling 2006-11-12 09:50:23 +00:00
parent 0bf8468210
commit 6d4c4240a1
2 changed files with 2 additions and 2 deletions

View File

@ -2551,7 +2551,7 @@ remove_empty_units_in_region(region *r)
}
}
if ((u->number == 0 && u->race != new_race[RC_SPELL]) || (u->age <= 0 && u->race == new_race[RC_SPELL])) {
destroy_unit(u);
if (F!=NULL) destroy_unit(u);
if (u->number==0) remove_unit(u);
}
if (*up==u) up=&u->next;

View File

@ -229,7 +229,7 @@ destroy_unit(unit * u)
}
if (*p_item == item) p_item=&item->next;
}
if (u->items && strlen(u->faction->passw)>0) {
if (u->items && (u->faction==NULL || strlen(u->faction->passw)>0)) {
distribute_items(u);
}
}