ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/request.C
(Generate patch)

Comparing deliantra/server/socket/request.C (file contents):
Revision 1.92 by root, Mon Apr 30 17:39:59 2007 UTC vs.
Revision 1.95 by root, Thu May 3 09:29:45 2007 UTC

730 730
731/** 731/**
732 * Get player's current range attack in obuf. 732 * Get player's current range attack in obuf.
733 */ 733 */
734static void 734static void
735rangetostring (object *ob, char *obuf) 735rangetostring (player *pl, char *obuf)
736{ 736{
737 dynbuf_text buf; 737 dynbuf_text buf;
738 738
739 player *pl = ob->contr;
740
741 if (pl->ranged_skill) 739 if (pl->ranged_ob)
742 buf << " Range: " 740 buf << " Range: " << pl->ranged_ob->name;
743 << (pl->ranged_ob
744 ? pl->ranged_ob->name
745 : pl->ranged_skill->name);
746 741
747 if (pl->combat_skill) 742 if (pl->combat_ob)
748 buf << " Combat: " 743 buf << " Combat: " << pl->combat_ob->name;
749 << (pl->combat_ob
750 ? pl->combat_ob->name
751 : pl->combat_skill->name);
752 744
753 if (pl->golem) 745 if (pl->golem)
754 buf << " Golem: " << pl->golem->name; 746 buf << " Golem: " << pl->golem->name;
755 747
756 if (buf.empty ()) 748 buf.linearise (obuf);
757 *obuf = 0; 749 obuf [buf.size ()] = 0;
758 else
759 memcpy (obuf, buf.linearise () + 1, buf.size () - 1);
760} 750}
761 751
762#define AddIfInt64(Old,New,Type) if (Old != New) {\ 752#define AddIfInt64(Old,New,Type) if (Old != New) {\
763 Old = New; \ 753 Old = New; \
764 sl << uint8 (Type) << uint64 (New); \ 754 sl << uint8 (Type) << uint64 (New); \
871 AddIfInt (ns->last_path_attuned, ob->path_attuned, CS_STAT_SPELL_ATTUNE); 861 AddIfInt (ns->last_path_attuned, ob->path_attuned, CS_STAT_SPELL_ATTUNE);
872 AddIfInt (ns->last_path_repelled, ob->path_repelled, CS_STAT_SPELL_REPEL); 862 AddIfInt (ns->last_path_repelled, ob->path_repelled, CS_STAT_SPELL_REPEL);
873 AddIfInt (ns->last_path_denied, ob->path_denied, CS_STAT_SPELL_DENY); 863 AddIfInt (ns->last_path_denied, ob->path_denied, CS_STAT_SPELL_DENY);
874 } 864 }
875 865
876 rangetostring (ob, buf); /* we want use the new fire & run system in new client */ 866 rangetostring (pl, buf); /* we want use the new fire & run system in new client */
877 AddIfString (ns->stats.range, buf, CS_STAT_RANGE); 867 AddIfString (ns->stats.range, buf, CS_STAT_RANGE);
878 set_title (ob, buf); 868 set_title (ob, buf);
879 AddIfString (ns->stats.title, buf, CS_STAT_TITLE); 869 AddIfString (ns->stats.title, buf, CS_STAT_TITLE);
880 870
881 /* Only send it away if we have some actual data */ 871 /* Only send it away if we have some actual data */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines