--- deliantra/server/common/treasure.C 2008/05/05 22:18:00 1.77 +++ deliantra/server/common/treasure.C 2008/10/05 14:16:13 1.83 @@ -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; @@ -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; @@ -1638,8 +1631,10 @@ /* if donor has some attacktypes, the flesh is poisonous */ if (donor->attacktype & AT_POISON) item->type = POISON; + if (donor->attacktype & AT_ACID) item->stats.hp = -1 * item->stats.food; + SET_FLAG (item, FLAG_NO_STEAL); } } @@ -1686,7 +1681,7 @@ if (at->next) free_artifact (at->next); if (at->allowed) free_charlinks (at->allowed); - at->item->destroy (1); + at->item->destroy (); sfree (at); }