… | |
… | |
387 | LOG (llevDebug, "Freed %d archetypes, %d faces\n", i, f); |
387 | LOG (llevDebug, "Freed %d archetypes, %d faces\n", i, f); |
388 | } |
388 | } |
389 | |
389 | |
390 | archetype::archetype () |
390 | archetype::archetype () |
391 | { |
391 | { |
392 | clone.clear (); /* to initial state other also */ |
|
|
393 | CLEAR_FLAG (&clone, FLAG_FREED); /* This shouldn't matter, since copy_to */ |
392 | CLEAR_FLAG (&clone, FLAG_FREED); /* This shouldn't matter, since copy_to */ |
394 | SET_FLAG (&clone, FLAG_REMOVED); /* doesn't copy these flags... */ |
393 | SET_FLAG (&clone, FLAG_REMOVED); /* doesn't copy these flags... */ |
395 | } |
394 | } |
396 | |
395 | |
397 | archetype::~archetype () |
396 | archetype::~archetype () |
… | |
… | |
576 | object_thawer |
575 | object_thawer |
577 | thawer (filename); |
576 | thawer (filename); |
578 | |
577 | |
579 | LOG (llevDebug, " loading treasure...\n"); |
578 | LOG (llevDebug, " loading treasure...\n"); |
580 | load_treasures (); |
579 | load_treasures (); |
|
|
580 | LOG (llevDebug, " done\n"); |
581 | LOG (llevDebug, " done\n arch-pass 2...\n"); |
581 | LOG (llevDebug, " arch-pass 2...\n"); |
582 | second_arch_pass (thawer); |
582 | second_arch_pass (thawer); |
583 | LOG (llevDebug, " done\n"); |
583 | LOG (llevDebug, " done\n"); |
584 | #ifdef DEBUG |
584 | #ifdef DEBUG |
585 | check_generators (); |
585 | check_generators (); |
586 | #endif |
586 | #endif |
… | |
… | |
590 | |
590 | |
591 | /* |
591 | /* |
592 | * Creates and returns a new object which is a copy of the given archetype. |
592 | * Creates and returns a new object which is a copy of the given archetype. |
593 | * This function returns NULL on failure. |
593 | * This function returns NULL on failure. |
594 | */ |
594 | */ |
595 | |
|
|
596 | object * |
595 | object * |
597 | arch_to_object (archetype *at) |
596 | arch_to_object (archetype *at) |
598 | { |
597 | { |
599 | object *op; |
598 | object *op; |
600 | |
599 | |
… | |
… | |
616 | * Creates an object. This function is called by get_archetype() |
615 | * Creates an object. This function is called by get_archetype() |
617 | * if it fails to find the appropriate archetype. |
616 | * if it fails to find the appropriate archetype. |
618 | * Thus get_archetype() will be guaranteed to always return |
617 | * Thus get_archetype() will be guaranteed to always return |
619 | * an object, and never NULL. |
618 | * an object, and never NULL. |
620 | */ |
619 | */ |
621 | |
|
|
622 | object * |
620 | object * |
623 | create_singularity (const char *name) |
621 | create_singularity (const char *name) |
624 | { |
622 | { |
625 | object *op; |
623 | object *op; |
626 | char buf[MAX_BUF]; |
624 | char buf[MAX_BUF]; |
… | |
… | |
634 | |
632 | |
635 | /* |
633 | /* |
636 | * Finds which archetype matches the given name, and returns a new |
634 | * Finds which archetype matches the given name, and returns a new |
637 | * object containing a copy of the archetype. |
635 | * object containing a copy of the archetype. |
638 | */ |
636 | */ |
639 | |
|
|
640 | object * |
637 | object * |
641 | get_archetype (const char *name) |
638 | get_archetype (const char *name) |
642 | { |
639 | { |
643 | archetype *at = archetype::find (name); |
640 | archetype *at = archetype::find (name); |
644 | |
641 | |