--- deliantra/server/common/arch.C 2006/12/09 14:01:12 1.27 +++ deliantra/server/common/arch.C 2006/12/25 11:25:49 1.32 @@ -389,8 +389,7 @@ archetype::archetype () { - clear_object (&clone); /* to initial state other also */ - CLEAR_FLAG (&clone, FLAG_FREED); /* This shouldn't matter, since copy_object() */ + CLEAR_FLAG (&clone, FLAG_FREED); /* This shouldn't matter, since copy_to */ SET_FLAG (&clone, FLAG_REMOVED); /* doesn't copy these flags... */ } @@ -592,7 +591,6 @@ * Creates and returns a new object which is a copy of the given archetype. * This function returns NULL on failure. */ - object * arch_to_object (archetype *at) { @@ -606,8 +604,7 @@ return NULL; } - op = get_object (); - copy_object (&at->clone, op); + op = at->clone.clone (); op->arch = at; op->instantiate (); return op; @@ -619,7 +616,6 @@ * Thus get_archetype() will be guaranteed to always return * an object, and never NULL. */ - object * create_singularity (const char *name) { @@ -627,7 +623,7 @@ char buf[MAX_BUF]; sprintf (buf, "%s (%s)", ARCH_SINGULARITY, name); - op = get_object (); + op = object::create (); op->name = op->name_pl = buf; SET_FLAG (op, FLAG_NO_PICK); return op; @@ -808,16 +804,14 @@ clone_arch (int type) { archetype *at; - object *op = get_object (); if ((at = type_to_archetype (type)) == NULL) { LOG (llevError, "Can't clone archetype %d\n", type); - free_object (op); - return NULL; + return 0; } - copy_object (&at->clone, op); + object *op = at->clone.clone (); op->instantiate (); return op; }