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.83 by root, Mon Sep 29 10:20:48 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 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 */
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} 534}
550 535
551object * 536object *
552archetype::instance () 537archetype::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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines