… | |
… | |
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 |
128 | struct object_copy : attachable<object> |
129 | struct object_copy : attachable<object> |
129 | { |
130 | { |
… | |
… | |
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]; } |
306 | |
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 | |
307 | // fully recursive iterator |
318 | // fully recursive iterator |
308 | struct iterator_base |
319 | struct iterator_base |
309 | { |
320 | { |
310 | object *item; |
321 | object *item; |
311 | |
322 | |