--- deliantra/server/common/arch.C 2007/04/16 10:14:25 1.47 +++ deliantra/server/common/arch.C 2007/04/16 11:09:30 1.48 @@ -277,14 +277,6 @@ return 0; } -void -init_archetypes (void) -{ - load_archetypes (); - - empty_archetype = archetype::find ("empty_archetype"); -} - archetype::archetype () { clone.arch = this; @@ -421,24 +413,28 @@ * Reads and parses the archetype file (with the first and second-pass * functions). */ -void -load_archetypes (void) +bool +load_archetype_file (const char *filename) { - char filename[MAX_BUF]; - - sprintf (filename, "%s/%s", settings.datadir, settings.archetypes); - LOG (llevDebug, "Reading archetypes from %s:\n", filename); - object_thawer f (filename); f.next (); + // make sure the next - long - step is only done after a tick + coroapi::wait_for_tick_begin (); + if (!load_archetypes (f)) - cleanup ("unable to load archetypes"); + return false; warn_archetypes = 1; - load_treasures (); + empty_archetype = archetype::find ("empty_archetype"); + if (!empty_archetype) + return false; + + coroapi::cede (); + + return true; } /*