--- deliantra/server/common/treasure.C 2008/04/22 07:01:46 1.75 +++ deliantra/server/common/treasure.C 2008/09/29 10:32:50 1.82 @@ -47,8 +47,7 @@ treasurelist *, str_hash, str_equal, - slice_allocator< std::pair >, - true + slice_allocator< std::pair > > tl_map_t; static tl_map_t tl_map; @@ -257,7 +256,7 @@ op->expand_tail (); - if (op->blocked (creator->map, creator->x, creator->y)) + if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y)) op->destroy (); else { @@ -444,6 +443,7 @@ LOG (llevError, "In generate treasure, created multiple objects.\n"); ob->destroy (); + return tmp; } @@ -580,14 +580,17 @@ if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */ magic = (-magic); + op->weight = (op->arch->weight * (100 - magic * 10)) / 100; } else { if (op->type == ARMOUR) ARMOUR_SPEED (op) = (ARMOUR_SPEED (op) * (100 + magic * 10)) / 100; + if (magic < 0 && !(rndm (3))) /* You can't just check the weight always */ magic = (-magic); + op->weight = (op->weight * (100 - magic * 10)) / 100; } } @@ -965,13 +968,6 @@ op->value *= 5; /* Since it's not just decoration */ case RING: - if (!op->arch) // wtf? schmorp - { - op->destroy (); - op = 0; - break; - } - if (!IS_ARCH (op->arch, ring) && !IS_ARCH (op->arch, amulet)) /* It's a special artifact! */ break; @@ -1353,14 +1349,11 @@ */ if (op->type == HORN || op->type == POTION) { - object *tmp_obj; - /* Remove any spells this object currently has in it */ - while (op->inv) - op->inv->destroy (); + op->destroy_inv (false); - tmp_obj = arch_to_object (change->other_arch); - insert_ob_in_ob (tmp_obj, op); + object *tmp = arch_to_object (change->other_arch); + insert_ob_in_ob (tmp, op); } /* No harm setting this for potions/horns */ op->other_arch = change->other_arch; @@ -1686,7 +1679,7 @@ if (at->next) free_artifact (at->next); if (at->allowed) free_charlinks (at->allowed); - at->item->destroy (1); + at->item->destroy (); sfree (at); }