ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/object.h
(Generate patch)

Comparing deliantra/server/include/object.h (file contents):
Revision 1.97 by root, Wed Feb 7 02:13:06 2007 UTC vs.
Revision 1.98 by root, Wed Feb 7 23:50:01 2007 UTC

306 } 306 }
307 307
308 // return the dominant material of this item, always return something 308 // return the dominant material of this item, always return something
309 const materialtype_t *dominant_material () const; 309 const materialtype_t *dominant_material () const;
310 310
311 // return the volume of this object in cm³
311 uint64 volume () const 312 uint64 volume () const
312 { 313 {
313 return total_weight () / dominant_material ()->density; 314 return total_weight ()
315 * 1000
316 * (type == CONTAINER ? 1000 : 1)
317 / dominant_material ()->density;
314 } 318 }
315 319
316 MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } 320 MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; }
317 MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET 321 MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET
318 || type == CLOAK || type == BOOTS || type == GLOVES 322 || type == CLOAK || type == BOOTS || type == GLOVES

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines