… | |
… | |
726 | send_query (client *ns, uint8 flags, const char *text) |
726 | send_query (client *ns, uint8 flags, const char *text) |
727 | { |
727 | { |
728 | ns->send_packet_printf ("query %d %s", flags, text ? text : ""); |
728 | ns->send_packet_printf ("query %d %s", flags, text ? text : ""); |
729 | } |
729 | } |
730 | |
730 | |
|
|
731 | /** |
|
|
732 | * Get player's current range attack in obuf. |
|
|
733 | */ |
|
|
734 | static void |
|
|
735 | rangetostring (object *ob, char *obuf) |
|
|
736 | { |
|
|
737 | dynbuf_text buf; |
|
|
738 | |
|
|
739 | player *pl = ob->contr; |
|
|
740 | |
|
|
741 | if (pl->ranged_ob) |
|
|
742 | buf << " Range: " << pl->ranged_ob->name; |
|
|
743 | |
|
|
744 | if (pl->combat_ob) |
|
|
745 | buf << " Combat: " << pl->combat_ob->name; |
|
|
746 | |
|
|
747 | if (pl->golem) |
|
|
748 | buf << " Golem: " << pl->golem->name; |
|
|
749 | |
|
|
750 | if (buf.empty ()) |
|
|
751 | *obuf = 0; |
|
|
752 | else |
|
|
753 | { |
|
|
754 | memcpy (obuf, buf.linearise () + 1, buf.size () - 1); |
|
|
755 | obuf [buf.size ()] = 0; |
|
|
756 | } |
|
|
757 | } |
|
|
758 | |
731 | #define AddIfInt64(Old,New,Type) if (Old != New) {\ |
759 | #define AddIfInt64(Old,New,Type) if (Old != New) {\ |
732 | Old = New; \ |
760 | Old = New; \ |
733 | sl << uint8 (Type) << uint64 (New); \ |
761 | sl << uint8 (Type) << uint64 (New); \ |
734 | } |
762 | } |
735 | |
763 | |