summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-10 07:52:15 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:26 +0300
commitd92ebf2884faef37eb2169d6b763f02c13787b3e (patch)
treec6f8edc563a9750bf3964c7d43dfafa99d43e986 /src
parentbcc0738e5eacd865915798aefdc5a3b7fde48596 (diff)
downloadhercules-d92ebf2884faef37eb2169d6b763f02c13787b3e.tar.gz
hercules-d92ebf2884faef37eb2169d6b763f02c13787b3e.tar.bz2
hercules-d92ebf2884faef37eb2169d6b763f02c13787b3e.tar.xz
hercules-d92ebf2884faef37eb2169d6b763f02c13787b3e.zip
Update packet ZC_MAKINGARROW_LIST.
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c17
-rw-r--r--src/map/packets_struct.h14
2 files changed, 25 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 793aa9e71..e9d2cbffa 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3596,12 +3596,16 @@ static void clif_arrow_create_list(struct map_session_data *sd)
{
int i, c;
int fd;
+ int len;
+ struct PACKET_ZC_MAKINGARROW_LIST *p;
nullpo_retv(sd);
fd = sd->fd;
- WFIFOHEAD(fd, MAX_SKILL_ARROW_DB*2+4);
- WFIFOW(fd,0) = 0x1ad;
+ len = MAX_SKILL_ARROW_DB * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST);
+ WFIFOHEAD(fd, len);
+ p = WFIFOP(fd, 0);
+ p->packetType = 0x1ad;
for (i = 0, c = 0; i < MAX_SKILL_ARROW_DB; i++) {
int j;
@@ -3610,14 +3614,15 @@ static void clif_arrow_create_list(struct map_session_data *sd)
&& !sd->status.inventory[j].equip && sd->status.inventory[j].identify
) {
if ((j = itemdb_viewid(skill->dbs->arrow_db[i].nameid)) > 0)
- WFIFOW(fd,c*2+4) = j;
+ p->items[c].itemId = j;
else
- WFIFOW(fd,c*2+4) = skill->dbs->arrow_db[i].nameid;
+ p->items[c].itemId = skill->dbs->arrow_db[i].nameid;
c++;
}
}
- WFIFOW(fd,2) = c*2+4;
- WFIFOSET(fd, WFIFOW(fd,2));
+ len = c * sizeof(struct PACKET_ZC_MAKINGARROW_LIST_sub) + sizeof(struct PACKET_ZC_MAKINGARROW_LIST);
+ p->packetLength = len;
+ WFIFOSET(fd, len);
if (c > 0) {
sd->menuskill_id = AC_MAKINGARROW;
sd->menuskill_val = c;
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 05c85a55a..b15dabad2 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -2406,6 +2406,20 @@ struct PACKET_ZC_MAKABLEITEMLIST {
struct PACKET_ZC_MAKABLEITEMLIST_sub items[];
} __attribute__((packed));
+struct PACKET_ZC_MAKINGARROW_LIST_sub {
+#if PACKETVER_RE_NUM >= 20180704
+ uint32 itemId;
+#else
+ uint16 itemId;
+#endif
+} __attribute__((packed));
+
+struct PACKET_ZC_MAKINGARROW_LIST {
+ int16 packetType;
+ int16 packetLength;
+ struct PACKET_ZC_MAKINGARROW_LIST_sub items[];
+} __attribute__((packed));
+
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris