--- deliantra/server/include/object.h 2008/04/21 06:35:26 1.165 +++ deliantra/server/include/object.h 2008/04/30 10:31:04 1.170 @@ -432,6 +432,14 @@ */ MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } + // returns the outermost owner, never returns 0 + MTH object *outer_owner () + { + for (object *op = this; ; op = op->owner) + if (!op->owner) + return op; + } + // returns the outermost environment, never returns 0 MTH object *outer_env () { @@ -465,6 +473,9 @@ return !env && !flag [FLAG_REMOVED]; } + // returns the player that cna see this object, if any + MTH object *visible_to () const; + MTH std::string long_desc (object *who = 0); MTH std::string describe_monster (object *who = 0); MTH std::string describe_item (object *who = 0); @@ -538,13 +549,19 @@ } /* This returns TRUE if the object is something that - * should be displayed in the floorbox/inventory window + * a client might want to know about. */ MTH bool client_visible () const { return !invisible && type != PLAYER; } + // the client does nrof * this weight + MTH sint32 client_weight () const + { + return weight + carrying; + } + MTH struct region *region () const; void statusmsg (const char *msg, int color = NDI_BLACK); @@ -623,6 +640,7 @@ MTH void link (); MTH void unlink (); + MTH static object *get (const char *name); // find()->instance() MTH object *instance (); object_vector_index ACC (RW, archid); // index in archvector