… | |
… | |
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 */ |
… | |
… | |
1677 | free_artifact (artifact *at) |
1677 | free_artifact (artifact *at) |
1678 | { |
1678 | { |
1679 | if (at->next) free_artifact (at->next); |
1679 | if (at->next) free_artifact (at->next); |
1680 | if (at->allowed) free_charlinks (at->allowed); |
1680 | if (at->allowed) free_charlinks (at->allowed); |
1681 | |
1681 | |
1682 | at->item->destroy (true); |
1682 | at->item->destroy (); |
1683 | |
1683 | |
1684 | sfree (at); |
1684 | sfree (at); |
1685 | } |
1685 | } |
1686 | |
1686 | |
1687 | void |
1687 | void |