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.207 by root, Wed Sep 16 23:22:50 2009 UTC vs.
Revision 1.211 by sf-marcmagus, Sun Oct 11 05:43:35 2009 UTC

436 { 436 {
437 open_container (0); 437 open_container (0);
438 } 438 }
439 439
440 MTH object *force_find (shstr_tmp name); 440 MTH object *force_find (shstr_tmp name);
441 MTH void force_set_timer (int duration);
441 MTH object *force_add (shstr_tmp name, int duration = 0); 442 MTH object *force_add (shstr_tmp name, int duration = 0);
442 443
443 oblinkpt *find_link () const; 444 oblinkpt *find_link () const;
444 MTH void add_link (maptile *map, shstr_tmp id); 445 MTH void add_link (maptile *map, shstr_tmp id);
445 MTH void remove_link (); 446 MTH void remove_link ();
521 /* This return true if object has still randomitems which 522 /* This return true if object has still randomitems which
522 * could be expanded. 523 * could be expanded.
523 */ 524 */
524 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } 525 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; }
525 526
526 MTH bool has_dialogue () const { return *&msg == '@'; } 527 static bool msg_has_dialogue (const char *msg) { return *msg == '@'; }
528
529 MTH bool has_dialogue () const { return msg_has_dialogue (&msg); }
527 530
528 // returns the outermost owner, never returns 0 531 // returns the outermost owner, never returns 0
529 MTH object *outer_owner () 532 MTH object *outer_owner ()
530 { 533 {
531 object *op; 534 object *op;
707 // currently only used for players to make them temporarily visible 710 // currently only used for players to make them temporarily visible
708 // when they are invisible. 711 // when they are invisible.
709 MTH void make_noise (); 712 MTH void make_noise ();
710 713
711 /* animation */ 714 /* animation */
712 bool has_anim () { return animation_id; } 715 MTH bool has_anim () const { return animation_id; }
713 const animation &anim () const { return animations [animation_id]; } 716 const animation &anim () const { return animations [animation_id]; }
714 faceidx get_anim_frame (int frame) const { return anim ().faces [frame]; } 717 MTH faceidx get_anim_frame (int frame) const { return anim ().faces [frame]; }
715 void set_anim_frame (int frame) { face = get_anim_frame (frame); } 718 MTH void set_anim_frame (int frame) { face = get_anim_frame (frame); }
716 /* anim_frames () returns the number of animations allocated. The last 719 /* anim_frames () returns the number of animations allocated. The last
717 * usuable animation will be anim_frames () - 1 (for example, if an object 720 * usuable animation will be anim_frames () - 1 (for example, if an object
718 * has 8 animations, anim_frames () will return 8, but the values will 721 * has 8 animations, anim_frames () will return 8, but the values will
719 * range from 0 through 7. 722 * range from 0 through 7.
720 */ 723 */
721 int anim_frames () const { return anim ().num_animations; } 724 MTH int anim_frames () const { return anim ().num_animations; }
722 int anim_facings () const { return anim ().facings; } 725 MTH int anim_facings () const { return anim ().facings; }
726
727 MTH char *as_string ();
723 728
724protected: 729protected:
725 void link (); 730 void link ();
726 void unlink (); 731 void unlink ();
727 732
736// move this object to the top of its env's inventory to speed up 741// move this object to the top of its env's inventory to speed up
737// searches for it. 742// searches for it.
738static object * 743static object *
739splay (object *ob) 744splay (object *ob)
740{ 745{
741 if (ob->env && ob->env->inv != ob) 746 if (ob->above && ob->env)
742 { 747 {
743 if (ob->above) ob->above->below = ob->below; 748 if (ob->above) ob->above->below = ob->below;
744 if (ob->below) ob->below->above = ob->above; 749 if (ob->below) ob->below->above = ob->above;
745 750
746 ob->above = 0; 751 ob->above = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines