summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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