--- deliantra/server/common/loader.C 2006/12/30 21:07:46 1.32 +++ deliantra/server/common/loader.C 2007/01/01 00:41:02 1.35 @@ -553,7 +553,7 @@ object *tmp; - if (arch != NULL) + if (arch) tmp = arch_to_object (arch); else { @@ -565,7 +565,7 @@ // decativate the object we, as we are still going // to read the speed value. Objects should be activated // when the map, object or player is completly loaded. - tmp->deactivate (false); + tmp->deactivate (); parse_object (tmp, thawer, map_flags); @@ -608,7 +608,11 @@ op->arch = archetype::find (str); if (op->arch) - op->arch->clone.copy_to (op); + { + op->arch->clone.copy_to (op); + // copy_to activates, this should be fixed properly + op->deactivate (); + } else if (!arch_init) /* record the name of the broken object */ op->name = str; @@ -1056,16 +1060,7 @@ load_object (object_thawer &fp, object *op, int map_flags) { // cede every 500 objects loaded - { - static int cede_counter = 0; - - if (++cede_counter >= 500) - { - cede_counter = 0; - if (coroapi::nready ()) - coroapi::cede (); - } - } + coroapi::cede_every (500); return parse_object (op, fp, map_flags); } @@ -1447,6 +1442,9 @@ void save_object (object_freezer &fp, object *op, int flag) { + // cede every 500 objects saved + coroapi::cede_every (500); + /* Even if the object does have an owner, it would seem that we should * still save it. */ @@ -1468,6 +1466,6 @@ save_object (fp, tmp, flag); fp.put (op); - fp.put (KW_end, 0); + fp.put (KW_end); }