--- deliantra/server/common/treasure.C 2006/09/14 22:34:00 1.19 +++ deliantra/server/common/treasure.C 2006/12/12 20:53:02 1.23 @@ -459,12 +459,12 @@ /* Don't want to free the object we are about to return */ tmp = ob->inv; if (tmp != NULL) - remove_ob (tmp); + tmp->remove (); + if (ob->inv) - { - LOG (llevError, "In generate treasure, created multiple objects.\n"); - } - free_object (ob); + LOG (llevError, "In generate treasure, created multiple objects.\n"); + + ob->destroy (0); return tmp; } @@ -851,6 +851,12 @@ if (difficulty < 1) difficulty = 1; + if (INVOKE_OBJECT (ADD_BONUS, op, + ARG_OBJECT (creator != op ? creator : 0), + ARG_INT (difficulty), ARG_INT (max_magic), + ARG_INT (flags))) + return; + if (!(flags & GT_MINIMAL)) { if (op->arch == crown_arch) @@ -995,8 +1001,8 @@ case RING: if (op->arch == NULL) { - remove_ob (op); - free_object (op); + op->remove (); + op->destroy (0); op = NULL; break; } @@ -1509,8 +1515,8 @@ while (op->inv) { tmp_obj = op->inv; - remove_ob (tmp_obj); - free_object (tmp_obj); + tmp_obj->remove (); + tmp_obj->destroy (0); } tmp_obj = arch_to_object (change->other_arch); @@ -1558,12 +1564,8 @@ op->item_power = change->item_power; for (i = 0; i < NROFATTACKS; i++) - { - if (change->resist[i]) - { - op->resist[i] += change->resist[i]; - } - } + if (change->resist[i]) + op->resist[i] += change->resist[i]; if (change->stats.dam) { @@ -1851,7 +1853,7 @@ if (at->allowed) free_charlinks (at->allowed); - at->item->free (1); + at->item->destroy (1); delete at; } @@ -1861,7 +1863,7 @@ { artifactlist *nextal; - for (al = first_artifactlist; al != NULL; al = nextal) + for (al = first_artifactlist; al; al = nextal) { nextal = al->next;