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.117 by root, Mon May 7 04:21:11 2007 UTC vs.
Revision 1.120 by root, Sat May 12 16:06:42 2007 UTC

30#include "cfperl.h" 30#include "cfperl.h"
31#include "shstr.h" 31#include "shstr.h"
32 32
33typedef int tag_t; 33typedef int tag_t;
34 34
35#define NUM_BODY_LOCATIONS 14 35enum {
36#define BODY_ARMS 1 36 body_range,
37 body_shield,
38 body_combat,
39 body_arm,
40 body_torso,
41 body_head,
42 body_neck,
43 body_skill,
44 body_finger,
45 body_shoulder,
46 body_foot,
47 body_hand,
48 body_wrist,
49 body_waist,
50 NUM_BODY_LOCATIONS
51};
37 52
38/* See common/item.c */ 53/* See common/item.c */
39 54
40typedef struct Body_Locations 55typedef struct Body_Locations
41{ 56{
252 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different 267 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different
253 client_container *seen_by; // seen by which player/container currently? 268 client_container *seen_by; // seen by which player/container currently?
254 key_value *key_values; /* Fields not explictly known by the loader. */ 269 key_value *key_values; /* Fields not explictly known by the loader. */
255 270
256 bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all 271 bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all
272 void post_load_check (); // do some adjustments after parsing
257 static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go. 273 static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go.
258 bool write (object_freezer &f); 274 bool write (object_freezer &f);
259 275
260 MTH static object *create (); 276 MTH static object *create ();
261 object &operator =(const object &src); 277 object &operator =(const object &src);
273 { 289 {
274 if (!flag [FLAG_REMOVED]) 290 if (!flag [FLAG_REMOVED])
275 do_remove (); 291 do_remove ();
276 } 292 }
277 293
294 // move this object to the top of its env's inventory to speed up
295 // searches for it.
296 MTH void inv_splay ()
297 {
298 if (env && env->inv != this)
299 {
300 if (above) above->below = below;
301 if (below) below->above = above;
302
303 above = 0;
304 below = env->inv;
305 below->above = this;
306 env->inv = this;
307 }
308 }
309
278 static bool can_merge_slow (object *op1, object *op2); 310 static bool can_merge_slow (object *op1, object *op2);
279 311
280 // this is often used in time-critical code, so optimise 312 // this is often used in time-critical code, so optimise
281 MTH static bool can_merge (object *op1, object *op2) 313 MTH static bool can_merge (object *op1, object *op2)
282 { 314 {
285 && can_merge_slow (op1, op2); 317 && can_merge_slow (op1, op2);
286 } 318 }
287 319
288 MTH void set_owner (object *owner); 320 MTH void set_owner (object *owner);
289 MTH void set_speed (float speed); 321 MTH void set_speed (float speed);
290 MTH void set_weapon (object *ob); 322 MTH bool change_weapon (object *ob);
291 323
292 MTH void open_container (object *new_container); 324 MTH void open_container (object *new_container);
293 MTH void close_container () 325 MTH void close_container ()
294 { 326 {
295 open_container (0); 327 open_container (0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines