forked from github/server
crashfix for calling destroy_unit on a unit that has already been destroyed.
This commit is contained in:
parent
0bf8468210
commit
6d4c4240a1
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue