diff options
author | Andrei Karas <akaras@inbox.ru> | 2019-04-26 02:49:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2019-05-05 22:24:25 +0300 |
commit | 52d19df34575f43de69db33ba64b9b4ffe7f72c2 (patch) | |
tree | ea5145abf914c9671595528fdc5dfc3ee9e6f860 | |
parent | de778589658156245d87f6a73da6f81c933df286 (diff) | |
download | hercules-52d19df34575f43de69db33ba64b9b4ffe7f72c2.tar.gz hercules-52d19df34575f43de69db33ba64b9b4ffe7f72c2.tar.bz2 hercules-52d19df34575f43de69db33ba64b9b4ffe7f72c2.tar.xz hercules-52d19df34575f43de69db33ba64b9b4ffe7f72c2.zip |
Convert packeet ZC_ACK_MERGE_ITEM into structure
-rw-r--r-- | src/map/clif.c | 13 | ||||
-rw-r--r-- | src/map/packets_struct.h | 10 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 3e8a757fd..f16295b5a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -20634,12 +20634,13 @@ static int clif_comparemergeitem(const void *a, const void *b) static void clif_mergeitems(int fd, struct map_session_data *sd, int index, int amount, enum mergeitem_reason reason) { #if PACKETVER_MAIN_NUM >= 20120314 || PACKETVER_RE_NUM >= 20120221 || defined(PACKETVER_ZERO) - WFIFOHEAD(fd, 7); - WFIFOW(fd, 0) = 0x96f; - WFIFOW(fd, 2) = index + 2; - WFIFOW(fd, 4) = amount; - WFIFOB(fd, 6) = reason; - WFIFOSET(fd, 7); + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_ACK_MERGE_ITEM)); + struct PACKET_ZC_ACK_MERGE_ITEM *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_ACK_MERGE_ITEM; + p->index = index + 2; + p->amount = amount; + p->reason = reason; + WFIFOSET(fd, sizeof(struct PACKET_ZC_ACK_MERGE_ITEM)); #endif } diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index a9dba1720..80f3462c6 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3285,6 +3285,16 @@ struct PACKET_ZC_ACK_CLOSE_ROULETTE { DEFINE_PACKET_HEADER(ZC_ACK_CLOSE_ROULETTE, 0x0a1e); #endif +#if PACKETVER_MAIN_NUM >= 20120314 || PACKETVER_RE_NUM >= 20120221 || defined(PACKETVER_ZERO) +struct PACKET_ZC_ACK_MERGE_ITEM { + int16 packetType; + int16 index; + int16 amount; + uint8 reason; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ACK_MERGE_ITEM, 0x096f); +#endif + #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 |