cannot assert that free_unit has no faction (complicated reasons)

This commit is contained in:
Enno Rehling 2017-06-04 14:35:15 +02:00
parent 728f7ed389
commit 3e0bc4f26d
2 changed files with 2 additions and 2 deletions

View File

@ -917,6 +917,7 @@ void free_region(region * r)
while (r->units) { while (r->units) {
unit *u = r->units; unit *u = r->units;
r->units = u->next; r->units = u->next;
u->region = NULL;
uunhash(u); uunhash(u);
free_unit(u); free_unit(u);
free(u); free(u);

View File

@ -1400,12 +1400,11 @@ int invisible(const unit * target, const unit * viewer)
/** remove the unit from memory. /** remove the unit from memory.
* this frees all memory that's only accessible through the unit, * this frees all memory that's only accessible through the unit,
* and you should already have called uunhash and removed the unit from the * and you should already have called uunhash and removed the unit from the
* region and faction. * region.
*/ */
void free_unit(unit * u) void free_unit(unit * u)
{ {
assert(!u->region); assert(!u->region);
assert(!u->faction);
free(u->_name); free(u->_name);
free(u->display); free(u->display);
free_order(u->thisorder); free_order(u->thisorder);