--- deliantra/server/include/object.h 2006/08/13 17:16:02 1.4 +++ deliantra/server/include/object.h 2006/08/27 16:15:12 1.8 @@ -29,6 +29,9 @@ #ifndef OBJECT_H #define OBJECT_H +#include "cfperl.h" +#include "shstr.h" + typedef uint32 tag_t; #define NUM_BODY_LOCATIONS 12 #define BODY_ARMS 1 @@ -98,7 +101,9 @@ * MSW 2002-07-05 */ -struct object_simple { +struct object_simple : extendable { + static data_type get_dt () { return DT_OBJECT; } + /* These variables are not changed by copy_object() */ struct pl *contr; /* Pointer to the player which control this object */ struct object *next; /* Pointer to the next object in the free/used list */ @@ -255,6 +260,24 @@ }; struct object : object_special, object_simple { + void instantiate_ (); + void instantiate () + { + if (attach) + { + instantiate_ (); + free_string (attach); + attach = 0; + } + } + void clone (object *destination) + { + if (attach) + destination->attach = add_refcount (attach); + + if (self || cb) + INVOKE_OBJECT (CLONE, this, ARG_OBJECT (destination)); + } }; typedef struct oblnk { /* Used to link together several objects */ @@ -351,6 +374,4 @@ #define ARCH_DEPLETION "depletion" #define ARCH_SYMPTOM "symptom" -extern void (*object_free_callback)(object *ob); // called for every object_free - #endif