--- deliantra/server/include/object.h 2006/08/31 17:54:14 1.14 +++ deliantra/server/include/object.h 2006/09/03 14:33:48 1.16 @@ -46,15 +46,6 @@ extern Body_Locations body_locations[NUM_BODY_LOCATIONS]; -typedef struct _event -{ - int type; - const char *hook; - const char *plugin; - const char *options; - struct _event *next; -} event; - /* * Each object (this also means archetypes!) could have a few of these * "dangling" from it; this could also end up containing 'parse errors'. @@ -65,11 +56,10 @@ * accessing the list directly. * Exception is if you want to walk this list for some reason. */ -typedef struct _key_value { - const char * key; - const char * value; - struct _key_value * next; -} key_value; +struct key_value { + key_value *next; + shstr key, value; +}; /* Definition for WILL_APPLY values. Replaces having harcoded values @@ -135,7 +125,6 @@ /* To get put into books and the like. */ sint16 x,y; /* Position in the map for this object */ - sint16 ox,oy; /* For debugging: Where it was last inserted */ float speed; /* The overall speed of this object */ float speed_left; /* How much speed is left to spend this round */ uint32 nrof; /* How many of the objects */ @@ -237,17 +226,14 @@ MoveType move_slow; /* Movement types this slows down */ float move_slow_penalty; /* How much this slows down the object */ - event *events; - shstr custom_name; /* Custom name assigned by player */ key_value *key_values; /* Fields not explictly known by the loader. */ }; -struct object : object_special, object_simple { +struct object : object_special, object_simple, zero_initialised { void clone (object *destination) { - if (attach) - destination->attach = add_refcount (attach); + destination->attach = attach; if (self || cb) INVOKE_OBJECT (CLONE, this, ARG_OBJECT (destination)); @@ -275,8 +261,9 @@ * by the object structure */ -typedef struct archt { - const char *name; /* More definite name, like "generate_kobold" */ +typedef struct archt : zero_initialised +{ + shstr name; /* More definite name, like "generate_kobold" */ struct archt *next; /* Next archetype in a linked list */ struct archt *head; /* The main part of a linked object */ struct archt *more; /* Next part of a linked object */ @@ -295,7 +282,7 @@ extern int nrofallocobjects; extern int nroffreeobjects; -/* This returns TRUE if the object is somethign that +/* This returns TRUE if the object is something that * should be displayed in the look window */ #define LOOK_OBJ(ob) (!ob->invisible && ob->type!=PLAYER && ob->type!=EVENT_CONNECTOR)