summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-11-28 20:53:50 +0300
committerAndrei Karas <akaras@inbox.ru>2018-12-12 21:18:06 +0300
commitb0143067c797a502ffe2cf122fa8e364a0634571 (patch)
treebdb3f31306de76855eb12285d62c70df1565861c
parenteaeebdc9ddaa62488a58885c6a20b43d67e43d4a (diff)
downloadhercules-b0143067c797a502ffe2cf122fa8e364a0634571.tar.gz
hercules-b0143067c797a502ffe2cf122fa8e364a0634571.tar.bz2
hercules-b0143067c797a502ffe2cf122fa8e364a0634571.tar.xz
hercules-b0143067c797a502ffe2cf122fa8e364a0634571.zip
Update packet ZC_AUTOSPELLLIST
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/packets_struct.h29
2 files changed, 17 insertions, 20 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index df7b3839b..9f56e0136 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7512,10 +7512,11 @@ static void clif_pet_food(struct map_session_data *sd, int foodid, int fail)
/// 01cd { <skill id>.L }*7
static void clif_autospell(struct map_session_data *sd, uint16 skill_lv)
{
+#if PACKETVER_MAIN_NUM >= 20090406 || defined(PACKETVER_RE) || defined(PACKETVER_ZERO) || PACKETVER_SAK_NUM >= 20080618
nullpo_retv(sd);
int fd = sd->fd;
-#if PACKETVER_RE_NUM >= 20181031
+#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031
// reserve space for 7 skills
WFIFOHEAD(fd, sizeof(struct PACKET_ZC_AUTOSPELLLIST) + 4 * 7);
#else
@@ -7523,7 +7524,7 @@ static void clif_autospell(struct map_session_data *sd, uint16 skill_lv)
#endif
struct PACKET_ZC_AUTOSPELLLIST *p = WFIFOP(fd, 0);
memset(p, 0, sizeof(struct PACKET_ZC_AUTOSPELLLIST));
- p->packetType = autoSpellList;
+ p->packetType = HEADER_ZC_AUTOSPELLLIST;
int index = 0;
if (skill_lv > 0 && pc->checkskill(sd, MG_NAPALMBEAT) > 0)
@@ -7541,7 +7542,7 @@ static void clif_autospell(struct map_session_data *sd, uint16 skill_lv)
if (skill_lv > 9 && pc->checkskill(sd, MG_FROSTDIVER) > 0)
p->skills[index++] = MG_FROSTDIVER;
-#if PACKETVER_RE_NUM >= 20181031
+#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031
const int len = sizeof(struct PACKET_ZC_AUTOSPELLLIST) + index * 4;
p->packetLength = len;
#else
@@ -7551,6 +7552,7 @@ static void clif_autospell(struct map_session_data *sd, uint16 skill_lv)
sd->menuskill_id = SA_AUTOSPELL;
sd->menuskill_val = skill_lv;
+#endif
}
/// Devotion's visual effect (ZC_DEVOTIONLIST).
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 5c9a60465..0542021ec 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -441,11 +441,6 @@ enum packet_headers {
#else
guildLeave = 0x15a,
#endif
-#if PACKETVER_RE_NUM >= 20181031
- autoSpellList = 0xafb,
-#else
- autoSpellList = 0x1cd,
-#endif
};
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
@@ -2904,22 +2899,22 @@ struct PACKET_ZC_CAMERA_INFO {
float latitude;
} __attribute__((packed));
-#if PACKETVER_RE_NUM >= 20181031
-#define PACKET_ZC_AUTOSPELLLIST PACKET_ZC_AUTOSPELLLIST2
-#else
-#define PACKET_ZC_AUTOSPELLLIST PACKET_ZC_AUTOSPELLLIST1
-#endif
-
-struct PACKET_ZC_AUTOSPELLLIST1 {
- int16 packetType;
- int skills[7];
-} __attribute__((packed));
-
-struct PACKET_ZC_AUTOSPELLLIST2 {
+#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031
+// PACKET_ZC_AUTOSPELLLIST2
+struct PACKET_ZC_AUTOSPELLLIST {
int16 packetType;
int16 packetLength;
int skills[];
} __attribute__((packed));
+DEFINE_PACKET_HEADER(ZC_AUTOSPELLLIST, 0x0afb);
+#elif PACKETVER_MAIN_NUM >= 20090406 || defined(PACKETVER_RE) || defined(PACKETVER_ZERO) || PACKETVER_SAK_NUM >= 20080618
+// PACKET_ZC_AUTOSPELLLIST1
+struct PACKET_ZC_AUTOSPELLLIST {
+ int16 packetType;
+ int skills[7];
+} __attribute__((packed));
+DEFINE_PACKET_HEADER(ZC_AUTOSPELLLIST, 0x01cd);
+#endif
#if PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO)
#if PACKETVER_MAIN_NUM >= 20181017 || PACKETVER_RE_NUM >= 20181017 || PACKETVER_ZERO_NUM >= 20181024