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.166 by root, Mon Apr 21 23:35:24 2008 UTC vs.
Revision 1.170 by root, Wed Apr 30 10:31:04 2008 UTC

430 /* This return true if object has still randomitems which 430 /* This return true if object has still randomitems which
431 * could be expanded. 431 * could be expanded.
432 */ 432 */
433 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } 433 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; }
434 434
435 // returns the outermost owner, never returns 0
436 MTH object *outer_owner ()
437 {
438 for (object *op = this; ; op = op->owner)
439 if (!op->owner)
440 return op;
441 }
442
435 // returns the outermost environment, never returns 0 443 // returns the outermost environment, never returns 0
436 MTH object *outer_env () 444 MTH object *outer_env ()
437 { 445 {
438 for (object *op = this; ; op = op->env) 446 for (object *op = this; ; op = op->env)
439 if (!op->env) 447 if (!op->env)
539 { 547 {
540 return this; 548 return this;
541 } 549 }
542 550
543 /* This returns TRUE if the object is something that 551 /* This returns TRUE if the object is something that
544 * should be displayed in the floorbox/inventory window 552 * a client might want to know about.
545 */ 553 */
546 MTH bool client_visible () const 554 MTH bool client_visible () const
547 { 555 {
548 return !invisible && type != PLAYER; 556 return !invisible && type != PLAYER;
557 }
558
559 // the client does nrof * this weight
560 MTH sint32 client_weight () const
561 {
562 return weight + carrying;
549 } 563 }
550 564
551 MTH struct region *region () const; 565 MTH struct region *region () const;
552 566
553 void statusmsg (const char *msg, int color = NDI_BLACK); 567 void statusmsg (const char *msg, int color = NDI_BLACK);
624 MTH static archetype *find (const_utf8_string name); 638 MTH static archetype *find (const_utf8_string name);
625 639
626 MTH void link (); 640 MTH void link ();
627 MTH void unlink (); 641 MTH void unlink ();
628 642
643 MTH static object *get (const char *name); // find()->instance()
629 MTH object *instance (); 644 MTH object *instance ();
630 645
631 object_vector_index ACC (RW, archid); // index in archvector 646 object_vector_index ACC (RW, archid); // index in archvector
632 shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */ 647 shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */
633 648

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines