… | |
… | |
530 | } |
530 | } |
531 | } |
531 | } |
532 | while (--cnt); |
532 | while (--cnt); |
533 | } |
533 | } |
534 | |
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 | } |
|
|
550 | |
|
|
551 | object * |
535 | object * |
552 | archetype::instance () |
536 | archetype::instance () |
553 | { |
537 | { |
554 | object *op = clone (); |
538 | object *op = clone (); |
555 | op->instantiate (); |
539 | op->instantiate (); |