--- deliantra/server/common/treasure.C 2006/09/04 13:55:54 1.12 +++ 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.12 2006/09/04 13:55:54 root Exp $"; + * "$Id: treasure.C,v 1.15 2006/09/09 21:48:28 root Exp $"; */ /* @@ -422,8 +422,8 @@ if (t->nrof && tmp->nrof <= 1) tmp->nrof = RANDOM () % ((int) t->nrof) + 1; -// fix_generated_item (tmp, op, difficulty, t->magic, flag); -// change_treasure (t, tmp); + fix_generated_item (tmp, op, difficulty, t->magic, flag); + change_treasure (t, tmp); put_treasure (tmp, op, flag); } } @@ -528,7 +528,7 @@ int level_for_item (const object * op, int difficulty) { - int mult = 0, olevel = 0; + int olevel = 0; if (!op->inv) { @@ -1327,7 +1327,7 @@ char filename[MAX_BUF], buf[HUGE_BUF], *cp, *next; artifact *art = NULL; linked_char *tmp; - int value, comp; + int value; artifactlist *al; if (has_been_inited) @@ -1430,7 +1430,7 @@ void add_abilities (object * op, object * change) { - int i, j, tmp; + int i, tmp; if (change->face != blank_face) { @@ -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); } }