--- deliantra/server/include/object.h 2008/12/23 00:39:48 1.189 +++ deliantra/server/include/object.h 2008/12/28 06:59:27 1.192 @@ -385,6 +385,14 @@ insert_at (this, this); } + // high-level move functions, return true if successful + int move (int dir, object *originator); + + int move (int dir) + { + return move (dir, this); + } + static bool can_merge_slow (object *op1, object *op2); // this is often used in time-critical code, so optimise @@ -453,7 +461,7 @@ // return the volume of this object in cm³ MTH uint64 volume () const { - return total_weight () + return (uint64)total_weight () * 1000 * (type == CONTAINER ? 1000 : 1) / dominant_material ()->density; @@ -540,6 +548,11 @@ return !flag [FLAG_REMOVED]; } + MTH bool is_player () const + { + return !!contr; + } + MTH bool affects_los () const { return glow_radius || flag [FLAG_BLOCKSVIEW]; @@ -759,7 +772,7 @@ extern archvec archetypes; // "safely" iterate over inv in a way such that the current item is removable -// quite horrible, thats why its hidden in some macro +// quite horrible, that's why its hidden in some macro #define for_inv_removable(op,var) \ for (object *var, *next_ = (op)->inv; (var = next_), var && (next_ = var->below), var; )