… | |
… | |
457 | create_treasure (t, ob, 0, difficulty, 0); |
457 | create_treasure (t, ob, 0, difficulty, 0); |
458 | |
458 | |
459 | /* Don't want to free the object we are about to return */ |
459 | /* Don't want to free the object we are about to return */ |
460 | tmp = ob->inv; |
460 | tmp = ob->inv; |
461 | if (tmp != NULL) |
461 | if (tmp != NULL) |
462 | remove_ob (tmp); |
462 | tmp->remove (); |
463 | |
463 | |
464 | if (ob->inv) |
464 | if (ob->inv) |
465 | LOG (llevError, "In generate treasure, created multiple objects.\n"); |
465 | LOG (llevError, "In generate treasure, created multiple objects.\n"); |
466 | |
466 | |
467 | free_object (ob); |
467 | ob->destroy (0); |
468 | return tmp; |
468 | return tmp; |
469 | } |
469 | } |
470 | |
470 | |
471 | /* |
471 | /* |
472 | * This is a new way of calculating the chance for an item to have |
472 | * This is a new way of calculating the chance for an item to have |
… | |
… | |
999 | op->value *= 5; /* Since it's not just decoration */ |
999 | op->value *= 5; /* Since it's not just decoration */ |
1000 | |
1000 | |
1001 | case RING: |
1001 | case RING: |
1002 | if (op->arch == NULL) |
1002 | if (op->arch == NULL) |
1003 | { |
1003 | { |
1004 | remove_ob (op); |
1004 | op->remove (); |
1005 | free_object (op); |
1005 | op->destroy (0); |
1006 | op = NULL; |
1006 | op = NULL; |
1007 | break; |
1007 | break; |
1008 | } |
1008 | } |
1009 | |
1009 | |
1010 | if (op->arch != ring_arch && op->arch != amulet_arch) /* It's a special artifact! */ |
1010 | if (op->arch != ring_arch && op->arch != amulet_arch) /* It's a special artifact! */ |
… | |
… | |
1513 | |
1513 | |
1514 | /* Remove any spells this object currently has in it */ |
1514 | /* Remove any spells this object currently has in it */ |
1515 | while (op->inv) |
1515 | while (op->inv) |
1516 | { |
1516 | { |
1517 | tmp_obj = op->inv; |
1517 | tmp_obj = op->inv; |
1518 | remove_ob (tmp_obj); |
1518 | tmp_obj->remove (); |
1519 | free_object (tmp_obj); |
1519 | tmp_obj->destroy (0); |
1520 | } |
1520 | } |
1521 | |
1521 | |
1522 | tmp_obj = arch_to_object (change->other_arch); |
1522 | tmp_obj = arch_to_object (change->other_arch); |
1523 | insert_ob_in_ob (tmp_obj, op); |
1523 | insert_ob_in_ob (tmp_obj, op); |
1524 | } |
1524 | } |