diff options
author | Andrei Karas <akaras@inbox.ru> | 2019-05-09 18:00:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2019-06-02 00:23:24 +0300 |
commit | d13334aeb2d3439d89530a1e88a968a977079be9 (patch) | |
tree | 73c0f963fe3a4cb4890ca03a1a221fef9de756cd | |
parent | e68d49654e4eb5f6749f16d2fc3ca4e7a747b91c (diff) | |
download | hercules-d13334aeb2d3439d89530a1e88a968a977079be9.tar.gz hercules-d13334aeb2d3439d89530a1e88a968a977079be9.tar.bz2 hercules-d13334aeb2d3439d89530a1e88a968a977079be9.tar.xz hercules-d13334aeb2d3439d89530a1e88a968a977079be9.zip |
Update packet CZ_SHORTCUTKEYBAR_ROTATE
-rw-r--r-- | src/map/clif.c | 23 | ||||
-rw-r--r-- | src/map/clif.h | 3 | ||||
-rw-r--r-- | src/map/packets.h | 7 | ||||
-rw-r--r-- | src/map/packets_struct.h | 18 |
4 files changed, 41 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 69a73e9f1..9f751a68d 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10864,11 +10864,23 @@ static void clif_hotkeys_send(struct map_session_data *sd, int tab) #endif } -static void clif_parse_HotkeyRowShift(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); -static void clif_parse_HotkeyRowShift(int fd, struct map_session_data *sd) +static void clif_parse_HotkeyRowShift1(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_HotkeyRowShift1(int fd, struct map_session_data *sd) { - int cmd = RFIFOW(fd, 0); - sd->status.hotkey_rowshift = RFIFOB(fd, packet_db[cmd].pos[0]); +#if PACKETVER_MAIN_NUM >= 20140129 || PACKETVER_RE_NUM >= 20140129 || defined(PACKETVER_ZERO) + const struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE1 *p = RFIFOP(fd, 0); + sd->status.hotkey_rowshift = p->rowshift; +#endif +} + +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 + const struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 *p = RFIFOP(fd, 0); + // need use p->tab + sd->status.hotkey_rowshift = p->rowshift; +#endif } static void clif_parse_Hotkey1(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -23789,7 +23801,8 @@ void clif_defaults(void) clif->pNPCMarketPurchase = clif_parse_NPCMarketPurchase; /* */ clif->add_item_options = clif_add_item_options; - clif->pHotkeyRowShift = clif_parse_HotkeyRowShift; + clif->pHotkeyRowShift1 = clif_parse_HotkeyRowShift1; + clif->pHotkeyRowShift2 = clif_parse_HotkeyRowShift2; clif->dressroom_open = clif_dressroom_open; clif->pOneClick_ItemIdentify = clif_parse_OneClick_ItemIdentify; /* Achievements [Smokexyz/Hercules] */ diff --git a/src/map/clif.h b/src/map/clif.h index bef2726f3..5c28f80dd 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1528,7 +1528,8 @@ struct clif_interface { void (*pNPCMarketPurchase) (int fd, struct map_session_data *sd); /* */ int (*add_item_options) (struct ItemOptions *buf, const struct item *it); - void (*pHotkeyRowShift) (int fd, struct map_session_data *sd); + void (*pHotkeyRowShift1) (int fd, struct map_session_data *sd); + void (*pHotkeyRowShift2) (int fd, struct map_session_data *sd); void (*dressroom_open) (struct map_session_data *sd, int view); void (*pOneClick_ItemIdentify) (int fd,struct map_session_data *sd); /* Cart Deco */ diff --git a/src/map/packets.h b/src/map/packets.h index b9f2d5910..6df05900e 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1667,10 +1667,8 @@ packet(0x96e,clif->ackmergeitems); // changed packet sizes #endif -// 2014-01-29bRagexeRE -#if PACKETVER >= 20140129 -// new packets - packet(0x0a01,clif->pHotkeyRowShift,2); // CZ_SHORTCUTKEYBAR_ROTATE +#if PACKETVER_MAIN_NUM >= 20140129 || PACKETVER_RE_NUM >= 20140129 || defined(PACKETVER_ZERO) + packet(0x0a01,clif->pHotkeyRowShift1); // CZ_SHORTCUTKEYBAR_ROTATE #endif // 2014-02-12aRagexeRE @@ -1953,6 +1951,7 @@ packet(0x96e,clif->ackmergeitems); #if PACKETVER_RE_NUM >= 20190508 packet(0x0b21,clif->pHotkey2); + packet(0x0b22,clif->pHotkeyRowShift2); // CZ_SHORTCUTKEYBAR_ROTATE #endif #endif /* MAP_PACKETS_H */ diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 1982ae7a1..5cc58affb 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1481,6 +1481,24 @@ struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 { } __attribute__((packed)); DEFINE_PACKET_HEADER(CZ_SHORTCUT_KEY_CHANGE2, 0x0b21); #endif + +#if PACKETVER_MAIN_NUM >= 20140129 || PACKETVER_RE_NUM >= 20140129 || defined(PACKETVER_ZERO) +struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE1 { + int16 packetType; + uint8 rowshift; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_SHORTCUTKEYBAR_ROTATE1, 0x0a01); +#endif + +#if PACKETVER_RE_NUM >= 20190508 +struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 { + int16 packetType; + uint16 tab; + uint8 rowshift; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_SHORTCUTKEYBAR_ROTATE2, 0x0b22); +#endif + #endif // HOTKEY_SAVING /** |