From 18867f88bf23779a89dbe7d8b7dfcd2cf78744c3 Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 17 Dec 2018 01:36:28 +0100 Subject: Fix compile errors with old packetvers Signed-off-by: Haru --- src/map/clif.c | 2 +- src/map/packets_struct.h | 41 +++++++++++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 11 deletions(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index e8780c6ff..28b953de5 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1628,7 +1628,7 @@ static bool clif_spawn(struct block_list *bl) /// 022e .24B .B .W .W .W .W .W .W .W .W .W .W .W .W .W .W .W .W .L .L .W .W static void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) { -#if PACKETVER_MAIN_NUM >= 20101005 || PACKETVER_RE_NUM >= 20080827 || defined(PACKETVER_ZERO_NUM) +#if PACKETVER_MAIN_NUM >= 20101005 || PACKETVER_RE_NUM >= 20080827 || defined(PACKETVER_ZERO) struct status_data *hstatus; enum homun_type htype; struct PACKET_ZC_PROPERTY_HOMUN p; diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index f9b5fab0d..166688a4e 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1391,9 +1391,9 @@ struct packet_npc_market_result_ack { } list[MAX_INVENTORY];/* assuming MAX_INVENTORY is max since you can't hold more than MAX_INVENTORY items thus cant buy that many at once. */ } __attribute__((packed)); -#if PACKETVER_MAIN_NUM >= 20131120 || PACKETVER_RE_NUM >= 20131106 || defined(PACKETVER_ZERO) /* inner struct figured by Ind after some annoying hour of debugging (data Thanks to Yommy) */ struct PACKET_ZC_NPC_MARKET_OPEN_sub { +#if PACKETVER_MAIN_NUM >= 20131120 || PACKETVER_RE_NUM >= 20131106 || defined(PACKETVER_ZERO) #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 uint32 nameid; #else @@ -1403,14 +1403,21 @@ struct PACKET_ZC_NPC_MARKET_OPEN_sub { uint32 price; uint32 qty; uint16 weight; +#else + UNAVAILABLE_STRUCT; +#endif } __attribute__((packed)); struct PACKET_ZC_NPC_MARKET_OPEN { +#if PACKETVER_MAIN_NUM >= 20131120 || PACKETVER_RE_NUM >= 20131106 || defined(PACKETVER_ZERO) int16 packetType; int16 packetLength; struct PACKET_ZC_NPC_MARKET_OPEN_sub list[]; +#else + UNAVAILABLE_STRUCT; +#endif } __attribute__((packed)); - +#if PACKETVER_MAIN_NUM >= 20131120 || PACKETVER_RE_NUM >= 20131106 || defined(PACKETVER_ZERO) DEFINE_PACKET_HEADER(ZC_NPC_MARKET_OPEN, 0x09d5); #endif @@ -1791,8 +1798,8 @@ struct PACKET_ZC_GROUP_LIST { struct PACKET_ZC_GROUP_LIST_SUB members[]; } __attribute__((packed)); -#if PACKETVER_MAIN_NUM >= 20130626 || PACKETVER_RE_NUM >= 20130605 || defined(PACKETVER_ZERO) struct PACKET_ZC_CLANINFO { +#if PACKETVER_MAIN_NUM >= 20130626 || PACKETVER_RE_NUM >= 20130605 || defined(PACKETVER_ZERO) int16 PacketType; int16 PacketLength; uint32 ClanID; @@ -1801,7 +1808,11 @@ struct PACKET_ZC_CLANINFO { char Map[MAP_NAME_LENGTH_EXT]; uint8 AllyCount; uint8 AntagonistCount; +#else + UNAVAILABLE_STRUCT; +#endif } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20130626 || PACKETVER_RE_NUM >= 20130605 || defined(PACKETVER_ZERO) DEFINE_PACKET_HEADER(ZC_CLANINFO, 0x098a); #endif @@ -2270,9 +2281,8 @@ struct PACKET_ZC_ACK_WEAPONREFINE { #endif } __attribute__((packed)); -#if PACKETVER_MAIN_NUM >= 20131230 || PACKETVER_RE_NUM >= 20131230 || defined(PACKETVER_ZERO_NUM) -// PACKET_ZC_PROPERTY_HOMUN2 -struct PACKET_ZC_PROPERTY_HOMUN { +struct PACKET_ZC_PROPERTY_HOMUN_2 { +#if PACKETVER_MAIN_NUM >= 20131230 || PACKETVER_RE_NUM >= 20131230 || defined(PACKETVER_ZERO) int16 packetType; char name[NAME_LENGTH]; // Bit field, bit 0 : rename_flag (1 = already renamed), bit 1 : homunc vaporized (1 = true), bit 2 : homunc dead (1 = true) @@ -2301,11 +2311,14 @@ struct PACKET_ZC_PROPERTY_HOMUN { uint32 expNext; uint16 skillPoints; uint16 range; +#else + UNAVAILABLE_STRUCT; +#endif } __attribute__((packed)); -DEFINE_PACKET_HEADER(ZC_PROPERTY_HOMUN, 0x09f7); -#elif PACKETVER_MAIN_NUM >= 20101005 || PACKETVER_RE_NUM >= 20080827 || defined(PACKETVER_ZERO_NUM) -// PACKET_ZC_PROPERTY_HOMUN1 -struct PACKET_ZC_PROPERTY_HOMUN { +struct PACKET_ZC_PROPERTY_HOMUN_1 { +#if PACKETVER_MAIN_NUM >= 20131230 || PACKETVER_RE_NUM >= 20131230 || defined(PACKETVER_ZERO) + UNAVAILABLE_STRUCT; +#elif PACKETVER_MAIN_NUM >= 20101005 || PACKETVER_RE_NUM >= 20080827 int16 packetType; char name[NAME_LENGTH]; // Bit field, bit 0 : rename_flag (1 = already renamed), bit 1 : homunc vaporized (1 = true), bit 2 : homunc dead (1 = true) @@ -2334,7 +2347,15 @@ struct PACKET_ZC_PROPERTY_HOMUN { uint32 expNext; uint16 skillPoints; uint16 range; +#else + UNAVAILABLE_STRUCT; +#endif } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20131230 || PACKETVER_RE_NUM >= 20131230 || defined(PACKETVER_ZERO) +#define PACKET_ZC_PROPERTY_HOMUN PACKET_ZC_PROPERTY_HOMUN_2 +DEFINE_PACKET_HEADER(ZC_PROPERTY_HOMUN, 0x09f7); +#elif PACKETVER_MAIN_NUM >= 20101005 || PACKETVER_RE_NUM >= 20080827 +#define PACKET_ZC_PROPERTY_HOMUN PACKET_ZC_PROPERTY_HOMUN_1 DEFINE_PACKET_HEADER(ZC_PROPERTY_HOMUN, 0x022e); #endif -- cgit v1.2.3-70-g09d2