Skip to content

Commit

Permalink
add missing zero packetver for AUTOSPELL_LIST2 packet
Browse files Browse the repository at this point in the history
  • Loading branch information
guilherme-gm committed Jan 7, 2024
1 parent 6a271b7 commit 2e7171a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/map/clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -8024,7 +8024,7 @@ static void clif_autospell(struct map_session_data *sd, uint16 skill_lv, int *sk
#if PACKETVER_MAIN_NUM >= 20090406 || defined(PACKETVER_RE) || defined(PACKETVER_ZERO) || PACKETVER_SAK_NUM >= 20080618
nullpo_retv(sd);

#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031
#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20180523
const int len = sizeof(struct PACKET_ZC_AUTOSPELLLIST) + sizeof(int) * list_len;
#else
const int len = sizeof(struct PACKET_ZC_AUTOSPELLLIST);
Expand All @@ -8041,7 +8041,7 @@ static void clif_autospell(struct map_session_data *sd, uint16 skill_lv, int *sk
memset(p, 0, sizeof(struct PACKET_ZC_AUTOSPELLLIST));

p->packetType = HEADER_ZC_AUTOSPELLLIST;
#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031
#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20180523
p->packetLength = len;
#endif
memcpy(p->skills, skill_ids_list, sizeof(int) * list_len);
Expand Down
4 changes: 2 additions & 2 deletions src/map/packets_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -3708,7 +3708,7 @@ struct PACKET_CZ_VIEW_CAMERAINFO {
DEFINE_PACKET_HEADER(CZ_VIEW_CAMERAINFO, 0x0a77);
#endif

#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031
#if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20180523
// PACKET_ZC_AUTOSPELLLIST2
struct PACKET_ZC_AUTOSPELLLIST {
int16 packetType;
Expand Down Expand Up @@ -4768,7 +4768,7 @@ struct PACKET_ZC_NOTIFY_SKILL {
int8 action;
} __attribute__((packed));
DEFINE_PACKET_HEADER(ZC_NOTIFY_SKILL, 0x01de);
#endif
#endif

#if PACKETVER_MAIN_NUM >= 20130731 || PACKETVER_RE_NUM >= 20130724 || defined(PACKETVER_ZERO)
struct PACKET_ZC_USE_SKILL {
Expand Down
2 changes: 1 addition & 1 deletion src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -25097,7 +25097,7 @@ static bool skill_read_autospell_db(const char *filename)
count++;
}

#if PACKETVER_MAIN_NUM < 20181128 && PACKETVER_RE_NUM < 20181031
#if PACKETVER_MAIN_NUM < 20181128 && PACKETVER_RE_NUM < 20181031 && PACKETVER_ZERO_NUM < 20180523
if (count > 7) {
ShowWarning("%s: Your current packet version only supports up to 7 autospell skills, but your autospell db contains \"%d\" skills. Some skills may not be shown.\n", __func__, count);
ShowWarning("%s: Update your packet version or reduce the number of skills to fix this warning.\n", __func__);
Expand Down

0 comments on commit 2e7171a

Please sign in to comment.