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.80 by root, Sun May 4 18:46:01 2008 UTC vs.
Revision 1.84 by root, Mon Sep 29 10:31:32 2008 UTC

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 at->destroy (); 528 at->destroy (true);
529 at->arch = 0; 529 at->arch = 0;
530 } 530 }
531 } 531 }
532 while (--cnt); 532 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 */
539object *
540arch_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} 533}
550 534
551object * 535object *
552archetype::instance () 536archetype::instance ()
553{ 537{
568 LOG (llevError | logBacktrace, "FATAL: creating singularity for '%s'.\n", name); 552 LOG (llevError | logBacktrace, "FATAL: creating singularity for '%s'.\n", name);
569 553
570 if (!strcmp (name, "bug")) 554 if (!strcmp (name, "bug"))
571 abort (); 555 abort ();
572 556
573 object *op = archetype::get ("bug"); 557 object *op = archetype::get (shstr_bug);
574 op->name = op->name_pl = format ("bug, please report (missing archetype %s)", name); 558 op->name = op->name_pl = format ("bug, please report (missing archetype %s)", name);
575 559
576 return op; 560 return op;
577} 561}
578 562

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines