… | |
… | |
730 | |
730 | |
731 | /** |
731 | /** |
732 | * Get player's current range attack in obuf. |
732 | * Get player's current range attack in obuf. |
733 | */ |
733 | */ |
734 | static void |
734 | static void |
735 | rangetostring (object *ob, char *obuf) |
735 | rangetostring (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) |
|
|
742 | { |
|
|
743 | buf.printf (" Range: %s", &pl->ranged_skill->name); |
|
|
744 | |
|
|
745 | if (pl->ranged_ob) |
739 | if (pl->ranged_ob) |
746 | buf.printf (" (%s)", query_base_name (pl->ranged_ob, 0)); |
740 | buf << " Range: " << pl->ranged_ob->name; |
747 | } |
|
|
748 | |
741 | |
749 | if (pl->combat_skill) |
|
|
750 | { |
|
|
751 | buf.printf (" Combat: %s", &pl->combat_skill->name); |
|
|
752 | |
|
|
753 | if (pl->combat_ob) |
742 | if (pl->combat_ob) |
754 | buf.printf (" (%s)", query_base_name (pl->combat_ob, 0)); |
743 | buf << " Combat: " << pl->combat_ob->name; |
755 | } |
|
|
756 | |
744 | |
757 | if (pl->golem) |
745 | if (pl->golem) |
758 | buf.printf (" Golem: %s", &pl->golem->name); |
746 | buf << " Golem: " << pl->golem->name; |
759 | |
747 | |
760 | strcpy (obuf, buf.linearise () + 1); |
748 | buf.linearise (obuf); |
|
|
749 | obuf [buf.size ()] = 0; |
761 | } |
750 | } |
762 | |
751 | |
763 | #define AddIfInt64(Old,New,Type) if (Old != New) {\ |
752 | #define AddIfInt64(Old,New,Type) if (Old != New) {\ |
764 | Old = New; \ |
753 | Old = New; \ |
765 | sl << uint8 (Type) << uint64 (New); \ |
754 | sl << uint8 (Type) << uint64 (New); \ |
… | |
… | |
872 | 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); |
873 | 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); |
874 | 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); |
875 | } |
864 | } |
876 | |
865 | |
877 | 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 */ |
878 | AddIfString (ns->stats.range, buf, CS_STAT_RANGE); |
867 | AddIfString (ns->stats.range, buf, CS_STAT_RANGE); |
879 | set_title (ob, buf); |
868 | set_title (ob, buf); |
880 | AddIfString (ns->stats.title, buf, CS_STAT_TITLE); |
869 | AddIfString (ns->stats.title, buf, CS_STAT_TITLE); |
881 | |
870 | |
882 | /* Only send it away if we have some actual data */ |
871 | /* Only send it away if we have some actual data */ |