--- deliantra/server/include/object.h 2007/02/07 23:50:01 1.98 +++ deliantra/server/include/object.h 2007/03/01 12:28:16 1.102 @@ -231,7 +231,7 @@ object *inv; /* Pointer to the first object in the inventory */ //TODO: container must move into client - object *ACC (RW, container); /* Current container being used. I think this + object_ptr ACC (RW, container); /* Current container being used. I think this * is only used by the player right now. */ object *ACC (RW, env); /* Pointer to the object which is the environment. @@ -241,6 +241,10 @@ object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different client_container *seen_by; // seen by which player/container currently? + bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all + static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go. + bool write (object_freezer &f); + MTH static object *create (); MTH void copy_to (object *dst); MTH object *clone (); // create + copy_to @@ -271,14 +275,14 @@ MTH void set_owner (object *owner); MTH void set_speed (float speed); - MTH void instantiate () + MTH void open_container (object *new_container); + MTH void close_container () { - if (!uuid.seq) // HACK - uuid = gen_uuid (); - - attachable::instantiate (); + open_container (0); } + MTH void instantiate (); + // recalculate all stats MTH void update_stats (); MTH void roll_stats (); @@ -443,11 +447,11 @@ extern activevec actives; #define for_all_objects(var) \ - for (int _i = 0; _i < objects.size (); ++_i) \ + for (unsigned _i = 0; _i < objects.size (); ++_i) \ declvar (object *, var, objects [_i]) #define for_all_actives(var) \ - for (int _i = 0; _i < actives.size (); ++_i) \ + for (unsigned _i = 0; _i < actives.size (); ++_i) \ declvar (object *, var, actives [_i]) typedef struct oblnk @@ -479,6 +483,7 @@ ~archetype (); void gather_callbacks (AV *&callbacks, event_type event) const; + static archetype *read (object_thawer &f); static archetype *find (const char *name); void hash_add (); // add to hashtable