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.57 by root, Mon Dec 18 03:00:02 2006 UTC vs.
Revision 1.61 by root, Thu Dec 21 01:33:50 2006 UTC

120 * This is typically the container that the object is in. 120 * This is typically the container that the object is in.
121 */ 121 */
122 object *ACC (RW, more); /* Pointer to the rest of a large body of objects */ 122 object *ACC (RW, more); /* Pointer to the rest of a large body of objects */
123 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different 123 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different
124 maptile *ACC (RW, map); /* Pointer to the map in which this object is present */ 124 maptile *ACC (RW, map); /* Pointer to the map in which this object is present */
125 client_container *seen_by; // seen by which player/container currently?
125}; 126};
126 127
127// these are being copied 128// these are being copied
128struct object_copy : attachable<object> 129struct object_copy : attachable<object>
129{ 130{
300 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } 301 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); }
301 302
302 /* This return true if object has still randomitems which 303 /* This return true if object has still randomitems which
303 * could be expanded. 304 * could be expanded.
304 */ 305 */
305 bool has_random_items () const { return randomitems && flags [FLAG_IS_A_TEMPLATE]; } 306 bool has_random_items () const { return randomitems && !flags [FLAG_IS_A_TEMPLATE]; }
307
308 // returns the player that has this object in his inventory, or 0
309 object *in_player () const
310 {
311 for (object *op = env; op; op = op->env)
312 if (op->type == PLAYER)
313 return op;
314
315 return 0;
316 }
317
318 // returns the mapspace this object is in
319 mapspace &ms () const;
306 320
307 // fully recursive iterator 321 // fully recursive iterator
308 struct iterator_base 322 struct iterator_base
309 { 323 {
310 object *item; 324 object *item;
399extern int nrofallocobjects; 413extern int nrofallocobjects;
400 414
401/* This returns TRUE if the object is something that 415/* This returns TRUE if the object is something that
402 * should be displayed in the look window 416 * should be displayed in the look window
403 */ 417 */
404#define LOOK_OBJ(ob) (!ob->invisible && ob->type!=PLAYER && ob->type!=EVENT_CONNECTOR) 418#define LOOK_OBJ(ob) (!ob->invisible && ob->type != PLAYER && ob->type != EVENT_CONNECTOR)
405 419
406/* Used by update_object to know if the object being passed is 420/* Used by update_object to know if the object being passed is
407 * being added or removed. 421 * being added or removed.
408 */ 422 */
409#define UP_OBJ_INSERT 1 423#define UP_OBJ_INSERT 1

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines