--- deliantra/server/include/object.h 2007/08/01 19:15:50 1.141 +++ deliantra/server/include/object.h 2007/08/27 06:29:17 1.146 @@ -252,7 +252,7 @@ object_vector_index ACC (RO, index); // index into objects object_vector_index ACC (RO, active); // index into actives - player_ptr ACC (RW, contr); /* Pointer to the player which control this object */ + player_ptr ACC (RW, contr); /* Pointer to the player which control this object, ALWAYS set *iff* type == PLAYER */ object *ACC (RW, below); /* Pointer to the object stacked below this one */ object *ACC (RW, above); /* Pointer to the object stacked above this one */ @@ -278,6 +278,7 @@ MTH int slottype () const; MTH static object *create (); + const mapxy &operator =(const mapxy &pos); object &operator =(const object &src); MTH void copy_to (object *dst); MTH object *clone (); // create + copy_to @@ -297,6 +298,13 @@ do_remove (); } + void move_to (const mapxy &pos) + { + remove (); + *this = pos; + insert_at (this, this); + } + static bool can_merge_slow (object *op1, object *op2); // this is often used in time-critical code, so optimise @@ -385,7 +393,7 @@ // 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 && !flag [FLAG_NO_MAP_SAVE]; } + MTH bool can_map_save () const { return !head && (!owner || owner->contr) && !contr && !flag [FLAG_NO_MAP_SAVE]; } /* This return true if object has still randomitems which * could be expanded. @@ -495,6 +503,9 @@ MTH struct region *region () const; + void statusmsg (const char *msg, int color = NDI_BLACK); + void failmsg (const char *msg, int color = NDI_RED); + protected: void link (); void unlink ();