… | |
… | |
304 | { |
304 | { |
305 | return weight * number_of (); |
305 | return weight * number_of (); |
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 | materialtype_t *dominant_material () const; |
309 | const materialtype_t *dominant_material () const; |
310 | |
310 | |
311 | uint64 volume () const |
311 | uint64 volume () const |
312 | { |
312 | { |
313 | return total_weight () / dominant_material ()->density; |
313 | return total_weight () / dominant_material ()->density; |
314 | } |
314 | } |