summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c14
-rw-r--r--src/map/packets_struct.h10
2 files changed, 15 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 3e6a3469d..999a232dc 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2935,10 +2935,10 @@ static void clif_inventoryStart(struct map_session_data *sd, enum inventory_type
nullpo_retv(sd);
nullpo_retv(name);
- char buf[sizeof(struct ZC_INVENTORY_START) + 24];
+ char buf[sizeof(struct PACKET_ZC_INVENTORY_START) + 24];
memset(buf, 0, sizeof(buf));
- struct ZC_INVENTORY_START *p = (struct ZC_INVENTORY_START *)buf;
- p->packetType = 0xb08;
+ struct PACKET_ZC_INVENTORY_START *p = (struct PACKET_ZC_INVENTORY_START *)buf;
+ p->packetType = HEADER_ZC_INVENTORY_START;
#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
p->invType = type;
#endif
@@ -2946,11 +2946,11 @@ static void clif_inventoryStart(struct map_session_data *sd, enum inventory_type
int strLen = (int)safestrnlen(name, 24) + 1;
if (strLen > 24)
strLen = 24;
- const int len = sizeof(struct ZC_INVENTORY_START) + strLen;
+ const int len = sizeof(struct PACKET_ZC_INVENTORY_START) + strLen;
p->packetLength = len;
safestrncpy(p->name, name, strLen);
#else
- const int len = sizeof(struct ZC_INVENTORY_START);
+ const int len = sizeof(struct PACKET_ZC_INVENTORY_START);
safestrncpy(p->name, name, NAME_LENGTH);
#endif
clif->send(p, len, &sd->bl, SELF);
@@ -2962,8 +2962,8 @@ static void clif_inventoryEnd(struct map_session_data *sd, enum inventory_type t
#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
nullpo_retv(sd);
- struct ZC_INVENTORY_END p;
- p.packetType = 0xb0b;
+ struct PACKET_ZC_INVENTORY_END p;
+ p.packetType = HEADER_ZC_INVENTORY_END;
#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
p.invType = type;
#endif
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 9c8c93865..f64fff199 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -1183,7 +1183,8 @@ struct ZC_STORE_ITEMLIST_NORMAL {
struct NORMALITEM_INFO list[MAX_ITEMLIST];
} __attribute__((packed));
-struct ZC_INVENTORY_START {
+#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
+struct PACKET_ZC_INVENTORY_START {
int16 packetType;
#if PACKETVER_RE_NUM >= 20180919 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
int16 packetLength;
@@ -1197,14 +1198,19 @@ struct ZC_INVENTORY_START {
char name[NAME_LENGTH];
#endif
} __attribute__((packed));
+DEFINE_PACKET_HEADER(ZC_INVENTORY_START, 0x0b08);
+#endif // PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
-struct ZC_INVENTORY_END {
+#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
+struct PACKET_ZC_INVENTORY_END {
int16 packetType;
#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
uint8 invType;
#endif
char flag;
} __attribute__((packed));
+DEFINE_PACKET_HEADER(ZC_INVENTORY_END, 0x0b0b);
+#endif // PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
struct ZC_STORE_ITEMLIST_EQUIP {
int16 PacketType;