From 0f4fd231e6660860c991bbcc59c075547245e71d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 15 May 2019 05:35:40 +0300 Subject: Use new shortcuts packets in zero 2019-05-15 and main 2019-05-22 --- src/common/mmo.h | 4 ++-- src/map/clif.c | 8 ++++---- src/map/packets.h | 2 +- src/map/packets_struct.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/mmo.h b/src/common/mmo.h index 9594a39eb..545d180fd 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -139,7 +139,7 @@ // Note that newer clients no longer save hotkeys in the registry! #define HOTKEY_SAVING -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 #define MAX_HOTKEYS 38 #elif PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO) // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268) @@ -156,7 +156,7 @@ #endif #endif // PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 || defined(PACKETVER_ZERO) -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 #define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2) #else #define MAX_HOTKEYS_DB MAX_HOTKEYS diff --git a/src/map/clif.c b/src/map/clif.c index f5fcc7d9d..2bab6391c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10825,7 +10825,7 @@ static void clif_hotkeysAll_send(struct map_session_data *sd) { #ifdef HOTKEY_SAVING clif->hotkeys(sd, 0); -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 // send second tab only if data exists for (int i = MAX_HOTKEYS; i < MAX_HOTKEYS * 2; i++) { if (sd->status.hotkeys[i].type != 0 || sd->status.hotkeys[i].id != 0 || sd->status.hotkeys[i].lv != 0) { @@ -10854,7 +10854,7 @@ static void clif_hotkeys_send(struct map_session_data *sd, int tab) else p.rotate = sd->status.hotkey_rowshift2; #endif -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 p.tab = tab; #endif const int offset = tab * MAX_HOTKEYS; @@ -10879,7 +10879,7 @@ static void clif_parse_HotkeyRowShift1(int fd, struct map_session_data *sd) static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) { -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 const struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 *p = RFIFOP(fd, 0); if (p->tab == 0) sd->status.hotkey_rowshift = p->rowshift; @@ -10911,7 +10911,7 @@ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) __attribute_ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) { #ifdef HOTKEY_SAVING -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 const struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 *p = RFIFOP(fd, 0); const unsigned short idx = p->index + p->tab * MAX_HOTKEYS; Assert_retv(idx < MAX_HOTKEYS_DB); diff --git a/src/map/packets.h b/src/map/packets.h index 6df05900e..8ff6c4993 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1949,7 +1949,7 @@ packet(0x96e,clif->ackmergeitems); packet(0x0b1c,clif->pPing); #endif -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 packet(0x0b21,clif->pHotkey2); packet(0x0b22,clif->pHotkeyRowShift2); // CZ_SHORTCUTKEYBAR_ROTATE #endif diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 5cc58affb..9d77540e2 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1423,7 +1423,7 @@ struct hotkey_data { int16 count; // Item Quantity/Skill Level } __attribute__((packed)); -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 #define MAX_HOTKEYS_PACKET 38 struct PACKET_ZC_SHORTCUT_KEY_LIST { int16 packetType; @@ -1472,7 +1472,7 @@ struct PACKET_CZ_SHORTCUT_KEY_CHANGE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUT_KEY_CHANGE1, 0x02ba); #endif -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 { int16 packetType; uint16 tab; @@ -1490,7 +1490,7 @@ struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUTKEYBAR_ROTATE1, 0x0a01); #endif -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 { int16 packetType; uint16 tab; -- cgit v1.2.3-60-g2f50