--- deliantra/server/include/object.h 2006/08/13 17:16:02 1.4 +++ deliantra/server/include/object.h 2006/08/29 05:03:55 1.11 @@ -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 : attachable { + 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 */ @@ -184,8 +189,6 @@ sint8 glow_radius; /* indicates the glow radius of the object */ living stats; /* Str, Con, Dex, etc */ sint64 perm_exp; /* Permanent exp */ - const char *current_weapon_script; /* The script of the currently used weapon. Executed */ - /* each time the object attacks something */ struct object *current_weapon; /* Pointer to the weapon currently used */ uint32 weapontype; /* type of weapon */ uint32 tooltype; /* type of tool or build facility */ @@ -255,6 +258,14 @@ }; struct object : object_special, object_simple { + 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 +362,4 @@ #define ARCH_DEPLETION "depletion" #define ARCH_SYMPTOM "symptom" -extern void (*object_free_callback)(object *ob); // called for every object_free - #endif