… | |
… | |
248 | * by another object. |
248 | * by another object. |
249 | */ |
249 | */ |
250 | //TODO: flag such as objects... as such (no drop, anybody?) |
250 | //TODO: flag such as objects... as such (no drop, anybody?) |
251 | if (op->type == SPELL) |
251 | if (op->type == SPELL) |
252 | { |
252 | { |
253 | op->destroy (true); |
253 | op->destroy (); |
254 | return; |
254 | return; |
255 | } |
255 | } |
256 | |
256 | |
257 | op->expand_tail (); |
257 | op->expand_tail (); |
258 | |
258 | |
259 | if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y)) |
259 | if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y)) |
260 | op->destroy (true); |
260 | op->destroy (); |
261 | else |
261 | else |
262 | { |
262 | { |
263 | SET_FLAG (op, FLAG_OBJ_ORIGINAL); |
263 | SET_FLAG (op, FLAG_OBJ_ORIGINAL); |
264 | op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON); |
264 | op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON); |
265 | } |
265 | } |
… | |
… | |
440 | tmp->remove (); |
440 | tmp->remove (); |
441 | |
441 | |
442 | if (ob->inv) |
442 | if (ob->inv) |
443 | LOG (llevError, "In generate treasure, created multiple objects.\n"); |
443 | LOG (llevError, "In generate treasure, created multiple objects.\n"); |
444 | |
444 | |
445 | ob->destroy (true); |
445 | ob->destroy (); |
446 | |
446 | |
447 | return tmp; |
447 | return tmp; |
448 | } |
448 | } |
449 | |
449 | |
450 | /* |
450 | /* |
… | |
… | |
1348 | * this object. |
1348 | * this object. |
1349 | */ |
1349 | */ |
1350 | if (op->type == HORN || op->type == POTION) |
1350 | if (op->type == HORN || op->type == POTION) |
1351 | { |
1351 | { |
1352 | /* Remove any spells this object currently has in it */ |
1352 | /* Remove any spells this object currently has in it */ |
1353 | op->destroy_inv (); |
1353 | op->destroy_inv (false); |
1354 | |
1354 | |
1355 | object *tmp = arch_to_object (change->other_arch); |
1355 | object *tmp = arch_to_object (change->other_arch); |
1356 | insert_ob_in_ob (tmp, op); |
1356 | insert_ob_in_ob (tmp, op); |
1357 | } |
1357 | } |
1358 | /* No harm setting this for potions/horns */ |
1358 | /* No harm setting this for potions/horns */ |
… | |
… | |
1629 | item->level = donor->level; |
1629 | item->level = donor->level; |
1630 | |
1630 | |
1631 | /* if donor has some attacktypes, the flesh is poisonous */ |
1631 | /* if donor has some attacktypes, the flesh is poisonous */ |
1632 | if (donor->attacktype & AT_POISON) |
1632 | if (donor->attacktype & AT_POISON) |
1633 | item->type = POISON; |
1633 | item->type = POISON; |
|
|
1634 | |
1634 | if (donor->attacktype & AT_ACID) |
1635 | if (donor->attacktype & AT_ACID) |
1635 | item->stats.hp = -1 * item->stats.food; |
1636 | item->stats.hp = -1 * item->stats.food; |
|
|
1637 | |
1636 | SET_FLAG (item, FLAG_NO_STEAL); |
1638 | SET_FLAG (item, FLAG_NO_STEAL); |
1637 | } |
1639 | } |
1638 | } |
1640 | } |
1639 | |
1641 | |
1640 | /* special_potion() - so that old potion code is still done right. */ |
1642 | /* special_potion() - so that old potion code is still done right. */ |
… | |
… | |
1677 | free_artifact (artifact *at) |
1679 | free_artifact (artifact *at) |
1678 | { |
1680 | { |
1679 | if (at->next) free_artifact (at->next); |
1681 | if (at->next) free_artifact (at->next); |
1680 | if (at->allowed) free_charlinks (at->allowed); |
1682 | if (at->allowed) free_charlinks (at->allowed); |
1681 | |
1683 | |
1682 | at->item->destroy (true); |
1684 | at->item->destroy (); |
1683 | |
1685 | |
1684 | sfree (at); |
1686 | sfree (at); |
1685 | } |
1687 | } |
1686 | |
1688 | |
1687 | void |
1689 | void |