--- deliantra/server/common/treasure.C 2006/12/12 20:53:02 1.23 +++ deliantra/server/common/treasure.C 2006/12/12 22:37:05 1.25 @@ -450,9 +450,11 @@ * inserted into, and then return that treausre */ object * -generate_treasure (treasurelist * t, int difficulty) +generate_treasure (treasurelist *t, int difficulty) { - object *ob = get_object (), *tmp; + difficulty = clamp (difficulty, 1, settings.max_level); + + object *ob = object::create (), *tmp; create_treasure (t, ob, 0, difficulty, 0); @@ -464,7 +466,7 @@ if (ob->inv) LOG (llevError, "In generate treasure, created multiple objects.\n"); - ob->destroy (0); + ob->destroy (); return tmp; } @@ -1001,9 +1003,8 @@ case RING: if (op->arch == NULL) { - op->remove (); - op->destroy (0); - op = NULL; + op->destroy (); + op = 0; break; } @@ -1392,7 +1393,7 @@ art->difficulty = (uint8) value; else if (!strncmp (cp, "Object", 6)) { - art->item = get_object (); + art->item = object::create (); if (!load_object (thawer, art->item, 0)) LOG (llevError, "Init_Artifacts: Could not load object.\n"); @@ -1513,11 +1514,7 @@ /* Remove any spells this object currently has in it */ while (op->inv) - { - tmp_obj = op->inv; - tmp_obj->remove (); - tmp_obj->destroy (0); - } + op->inv->destroy (); tmp_obj = arch_to_object (change->other_arch); insert_ob_in_ob (tmp_obj, op);