… | |
… | |
523 | op->head = 0; |
523 | op->head = 0; |
524 | op->more = 0; |
524 | op->more = 0; |
525 | op = next; |
525 | op = next; |
526 | } |
526 | } |
527 | |
527 | |
|
|
528 | op->destroy_inv (false); |
528 | at->destroy (); |
529 | at->destroy (true); |
529 | at->arch = 0; |
530 | at->arch = 0; |
530 | } |
531 | } |
531 | } |
532 | } |
532 | while (--cnt); |
533 | while (--cnt); |
533 | } |
|
|
534 | |
|
|
535 | /* |
|
|
536 | * Creates and returns a new object which is a copy of the given archetype. |
|
|
537 | * This function returns NULL on failure. |
|
|
538 | */ |
|
|
539 | object * |
|
|
540 | arch_to_object (archetype *at) |
|
|
541 | { |
|
|
542 | if (!at) |
|
|
543 | { |
|
|
544 | LOG (llevError, "Couldn't find archetype.\n"); |
|
|
545 | return 0; |
|
|
546 | } |
|
|
547 | |
|
|
548 | return at->instance (); |
|
|
549 | } |
534 | } |
550 | |
535 | |
551 | object * |
536 | object * |
552 | archetype::instance () |
537 | archetype::instance () |
553 | { |
538 | { |
… | |
… | |
568 | LOG (llevError | logBacktrace, "FATAL: creating singularity for '%s'.\n", name); |
553 | LOG (llevError | logBacktrace, "FATAL: creating singularity for '%s'.\n", name); |
569 | |
554 | |
570 | if (!strcmp (name, "bug")) |
555 | if (!strcmp (name, "bug")) |
571 | abort (); |
556 | abort (); |
572 | |
557 | |
573 | object *op = archetype::get ("bug"); |
558 | object *op = archetype::get (shstr_bug); |
574 | op->name = op->name_pl = format ("bug, please report (missing archetype %s)", name); |
559 | op->name = op->name_pl = format ("bug, please report (missing archetype %s)", name); |
575 | |
560 | |
576 | return op; |
561 | return op; |
577 | } |
562 | } |
578 | |
563 | |