ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/arch.C
(Generate patch)

Comparing deliantra/server/common/arch.C (file contents):
Revision 1.28 by root, Tue Dec 12 20:53:02 2006 UTC vs.
Revision 1.29 by root, Tue Dec 12 21:39:56 2006 UTC

388} 388}
389 389
390archetype::archetype () 390archetype::archetype ()
391{ 391{
392 clear_object (&clone); /* to initial state other also */ 392 clear_object (&clone); /* to initial state other also */
393 CLEAR_FLAG (&clone, FLAG_FREED); /* This shouldn't matter, since copy_object() */ 393 CLEAR_FLAG (&clone, FLAG_FREED); /* This shouldn't matter, since copy_to */
394 SET_FLAG (&clone, FLAG_REMOVED); /* doesn't copy these flags... */ 394 SET_FLAG (&clone, FLAG_REMOVED); /* doesn't copy these flags... */
395} 395}
396 396
397archetype::~archetype () 397archetype::~archetype ()
398{ 398{
604 LOG (llevError, "Couldn't find archetype.\n"); 604 LOG (llevError, "Couldn't find archetype.\n");
605 605
606 return NULL; 606 return NULL;
607 } 607 }
608 608
609 op = get_object (); 609 op = object::create ();
610 copy_object (&at->clone, op); 610 at->clone.copy_to (op);
611 op->arch = at; 611 op->arch = at;
612 op->instantiate (); 612 op->instantiate ();
613 return op; 613 return op;
614} 614}
615 615
625{ 625{
626 object *op; 626 object *op;
627 char buf[MAX_BUF]; 627 char buf[MAX_BUF];
628 628
629 sprintf (buf, "%s (%s)", ARCH_SINGULARITY, name); 629 sprintf (buf, "%s (%s)", ARCH_SINGULARITY, name);
630 op = get_object (); 630 op = object::create ();
631 op->name = op->name_pl = buf; 631 op->name = op->name_pl = buf;
632 SET_FLAG (op, FLAG_NO_PICK); 632 SET_FLAG (op, FLAG_NO_PICK);
633 return op; 633 return op;
634} 634}
635 635
806 806
807object * 807object *
808clone_arch (int type) 808clone_arch (int type)
809{ 809{
810 archetype *at; 810 archetype *at;
811 object *op = get_object (); 811 object *op = object::create ();
812 812
813 if ((at = type_to_archetype (type)) == NULL) 813 if ((at = type_to_archetype (type)) == NULL)
814 { 814 {
815 LOG (llevError, "Can't clone archetype %d\n", type); 815 LOG (llevError, "Can't clone archetype %d\n", type);
816 op->destroy (0); 816 op->destroy ();
817 return NULL; 817 return NULL;
818 } 818 }
819 819
820 copy_object (&at->clone, op); 820 at->clone.copy_to (op);
821 op->instantiate (); 821 op->instantiate ();
822 return op; 822 return op;
823} 823}
824 824
825/* 825/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines