--- deliantra/server/common/arch.C 2008/04/20 05:24:55 1.74 +++ deliantra/server/common/arch.C 2008/05/02 16:16:02 1.78 @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -136,7 +135,7 @@ * - a corresponding object if found; a singularity object if not found. * Note by MSW - it appears that it takes the full name and keeps * shortening it until it finds a match. I re-wrote this so that it - * doesn't malloc it each time - not that this function is used much, + * doesn't allocate it each time - not that this function is used much, * but it otherwise had a big memory leak. */ object * @@ -516,9 +515,18 @@ LOG (llevDebug, "garbage collect arch %s", at->debug_desc ()); assert (at->arch == at); // verify that refcnt == 1 is truely valid allarch.erase (idx); - at->arch = 0; - at->more = 0; + + // break chain + for (object *op = at->head_ (); op; ) + { + object *next = op->more; + op->head = 0; + op->more = 0; + op = next; + } + at->destroy (); + at->arch = 0; } } while (--cnt); @@ -588,6 +596,12 @@ return arch_to_object (at); } +object * +archetype::get (const char *name) +{ + return get_archetype (name); +} + /* * Returns the first archetype using the given type. * Used in treasure-generation.