--- deliantra/server/common/treasure.C 2006/09/07 09:37:12 1.14 +++ deliantra/server/common/treasure.C 2006/09/09 21:48:28 1.15 @@ -1,7 +1,7 @@ /* * static char *rcs_treasure_c = - * "$Id: treasure.C,v 1.14 2006/09/07 09:37:12 pippijn Exp $"; + * "$Id: treasure.C,v 1.15 2006/09/09 21:48:28 root Exp $"; */ /* @@ -1837,13 +1837,13 @@ void free_artifact (artifact * at) { - if (at->next) free_artifact (at->next); + if (at->allowed) free_charlinks (at->allowed); - delete at->item; + at->item->free (1); delete at; } @@ -1852,13 +1852,14 @@ free_artifactlist (artifactlist * al) { artifactlist *nextal; + for (al = first_artifactlist; al != NULL; al = nextal) { nextal = al->next; + if (al->items) - { - free_artifact (al->items); - } + free_artifact (al->items); + free (al); } }