--- deliantra/server/include/object.h 2006/12/26 08:54:59 1.70 +++ deliantra/server/include/object.h 2006/12/31 17:17:23 1.78 @@ -242,8 +242,8 @@ 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? - static vector active; // active objects, not yet used - static vector objects; // not used yet, use first->next->... + //static vector active_list; // active objects, not yet used + //static vector object_list; // not used yet, use first->next->... static object *first; // will be replaced by "objects" MTH static object *create (); @@ -290,8 +290,9 @@ MTH void change_luck (int value); // info must hold 256 * 3 bytes currently - MTH const char *debug_desc (char *info) const; + const char *debug_desc (char *info) const; MTH const char *debug_desc () const; + const char *flag_desc (char *desc, int len) const; MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET @@ -305,6 +306,14 @@ || (type == SPELL_EFFECT && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } + MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; } + + // temporary: wether the object can be saved in a map file + // contr => is a player + // head => only save head of a multitile object + // owner => can not reference owner yet + MTH bool can_map_save () const { return !contr && !head && !owner; } + /* This return true if object has still randomitems which * could be expanded. */ @@ -320,6 +329,25 @@ return 0; } + // "temporary" helper function + MTH object *head_ () + { + return head ? head : this; + } + + // insert object at same map position as 'where' + // handles both inventory and map "positions" + MTH object *insert_at (object *where, object *originator = 0, int flags = 0); + + MTH bool active () const; + MTH void activate (); + MTH void deactivate (); + MTH void activate_recursive (); + MTH void deactivate_recursive (); + + void enter_exit (object *exit);//PERL + MTH void enter_map (maptile *newmap, int x, int y); + // returns the mapspace this object is in mapspace &ms () const; @@ -339,6 +367,11 @@ object &operator * () const { return *item; } }; + MTH unsigned int random_seed () const + { + return (unsigned int)uuid.seq; + } + // depth-first recursive iterator struct depth_iterator : iterator_base {