--- deliantra/server/common/object.C 2006/08/25 17:11:52 1.2 +++ deliantra/server/common/object.C 2006/08/26 08:44:05 1.3 @@ -1,6 +1,6 @@ /* * static char *rcsid_object_c = - * "$Id: object.C,v 1.2 2006/08/25 17:11:52 root Exp $"; + * "$Id: object.C,v 1.3 2006/08/26 08:44:05 root Exp $"; */ /* @@ -54,8 +54,6 @@ object *free_objects; /* Pointer to the list of unused objects */ object *active_objects; /* List of active objects that need to be processed */ -void (*object_free_callback)(object *ob); - short freearr_x[SIZEOFFREE]= {0,0,1,1,1,0,-1,-1,-1,0,1,2,2,2,2,2,1,0,-1,-2,-2,-2,-2,-2,-1, 0,1,2,3,3,3,3,3,3,3,2,1,0,-1,-2,-3,-3,-3,-3,-3,-3,-3,-2,-1}; @@ -583,9 +581,7 @@ */ void clear_object(object *op) { - - if (object_free_callback) - object_free_callback (op); + op->clear (); event *evt; event *evt2; @@ -666,11 +662,7 @@ int is_freed=QUERY_FLAG(op,FLAG_FREED),is_removed=QUERY_FLAG(op,FLAG_REMOVED); event *evt, *evt2, *evt_new; - if (object_free_callback) - object_free_callback (op); - - // callback registries and self are empty for copied objects - // this ought to change in the future + op->clear (); /* Decrement the refcounts, but don't bother zeroing the fields; they'll be overwritten by memcpy. */ @@ -700,6 +692,7 @@ free_key_values(op); *(object_special *)op = *(object_special *)op2; + op->clone (op2); if(is_freed) SET_FLAG(op,FLAG_FREED); if(is_removed) SET_FLAG(op,FLAG_REMOVED); @@ -1074,8 +1067,7 @@ void free_object2(object *ob, int free_inventory) { object *tmp,*op; - if (object_free_callback) - object_free_callback (ob); + ob->clear (); if (!QUERY_FLAG(ob,FLAG_REMOVED)) { LOG(llevDebug,"Free object called with non removed object\n");