--- deliantra/server/include/object.h 2006/09/14 18:13:02 1.37 +++ deliantra/server/include/object.h 2006/09/16 22:24:12 1.40 @@ -90,26 +90,26 @@ UUID uuid; // Unique Identifier, survives saves etc. /* These variables are not changed by copy_object() */ - struct pl *ACC (RW, contr); /* Pointer to the player which control this object */ - struct object *ACC (RW, next); /* Pointer to the next object in the free/used list */ - struct object *ACC (RW, prev); /* Pointer to the previous object in the free/used list */ - struct object *ACC (RW, active_next); /* Next & previous object in the 'active' */ - struct object *ACC (RW, active_prev); /* List. This is used in process_events */ + player *ACC (RW, contr); /* Pointer to the player which control this object */ + object *ACC (RW, next); /* Pointer to the next object in the free/used list */ + object *ACC (RW, prev); /* Pointer to the previous object in the free/used list */ + object *ACC (RW, active_next); /* Next & previous object in the 'active' */ + object *ACC (RW, active_prev); /* List. This is used in process_events */ /* so that the entire object list does not */ /* need to be gone through. */ - struct object *ACC (RW, below); /* Pointer to the object stacked below this one */ - struct object *ACC (RW, above); /* Pointer to the object stacked above this one */ + object *ACC (RW, below); /* Pointer to the object stacked below this one */ + object *ACC (RW, above); /* Pointer to the object stacked above this one */ /* Note: stacked in the *same* environment */ - struct object *inv; /* Pointer to the first object in the inventory */ - struct object *ACC (RW, container); /* Current container being used. I think this + object *inv; /* Pointer to the first object in the inventory */ + object *ACC (RW, container); /* Current container being used. I think this * is only used by the player right now. */ - struct object *ACC (RW, env); /* Pointer to the object which is the environment. + object *ACC (RW, env); /* Pointer to the object which is the environment. * This is typically the container that the object is in. */ - struct object *ACC (RW, more); /* Pointer to the rest of a large body of objects */ - struct object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different - struct mapstruct *ACC (RW, map); /* Pointer to the map in which this object is present */ + object *ACC (RW, more); /* Pointer to the rest of a large body of objects */ + object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different + maptile *ACC (RW, map); /* Pointer to the map in which this object is present */ }; // these are being copied @@ -208,9 +208,9 @@ char *ACC (RW, spellarg); /* Following are values used by any object */ - struct treasureliststruct *ACC (RW, randomitems); /* Items to be generated */ - struct archetype *ACC (RW, arch); /* Pointer to archetype */ - struct archetype *ACC (RW, other_arch); /* Pointer used for various things - mostly used for what */ + treasurelist *ACC (RW, randomitems); /* Items to be generated */ + archetype *ACC (RW, arch); /* Pointer to archetype */ + archetype *ACC (RW, other_arch); /* Pointer used for various things - mostly used for what */ key_value *key_values; /* Fields not explictly known by the loader. */ /* this objects turns into or what this object creates */ uint32 flags[4]; /* various flags */ @@ -248,6 +248,8 @@ void clear (); void clone (object *destination); + bool destroyed () { return QUERY_FLAG (this, FLAG_FREED); } + void instantiate () { if (!uuid.seq) // HACK @@ -352,15 +354,17 @@ archetype (); ~archetype (); - shstr ACC (RW, name); /* More definite name, like "generate_kobold" */ - struct archetype *ACC (RW, next); /* Next archetype in a linked list */ - struct archetype *ACC (RW, head); /* The main part of a linked object */ - struct archetype *ACC (RW, more); /* Next part of a linked object */ - object ACC (RO, clone); /* An object from which to do copy_object() */ - uint32 ACC (RW, editable); /* editable flags (mainly for editor) */ - sint8 ACC (RW, tail_x), ACC (RW, tail_y); /* Where the lower right most portion of the object is - * in comparison to the head. - */ + static archetype *find (const char *arch); + + shstr ACC (RW, name); /* More definite name, like "generate_kobold" */ + struct archetype *ACC (RW, next); /* Next archetype in a linked list */ + struct archetype *ACC (RW, head); /* The main part of a linked object */ + struct archetype *ACC (RW, more); /* Next part of a linked object */ + object ACC (RO, clone); /* An object from which to do copy_object() */ + uint32 ACC (RW, editable); /* editable flags (mainly for editor) */ + sint8 ACC (RW, tail_x), ACC (RW, tail_y); /* Where the lower right most portion of the object is + * in comparison to the head. + */ }; extern object *objects;