summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-12-28 09:15:38 +0300
committerAndrei Karas <akaras@inbox.ru>2019-01-14 20:18:11 +0300
commite36edf03ce84351b27ef5d0f95b32c0f10725831 (patch)
tree8d1a2a6e6c0ffb1fdebe9722c1da2ded6852a2aa
parentd5aa551ad1ed0dd9d096d7df1053a17340721e46 (diff)
downloadhercules-e36edf03ce84351b27ef5d0f95b32c0f10725831.tar.gz
hercules-e36edf03ce84351b27ef5d0f95b32c0f10725831.tar.bz2
hercules-e36edf03ce84351b27ef5d0f95b32c0f10725831.tar.xz
hercules-e36edf03ce84351b27ef5d0f95b32c0f10725831.zip
Add packet CZ_NPC_BARTER_CLOSE
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/packets.h4
-rw-r--r--src/map/packets_struct.h7
4 files changed, 19 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 9c6ff9bad..1d0ced6c0 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -19921,6 +19921,12 @@ static void clif_parse_NPCMarketClosed(int fd, struct map_session_data *sd)
sd->npc_shopid = 0;
}
+static void clif_parse_NPCBarterClosed(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+static void clif_parse_NPCBarterClosed(int fd, struct map_session_data *sd)
+{
+ sd->npc_shopid = 0;
+}
+
static void clif_npc_market_purchase_ack(struct map_session_data *sd, const struct itemlist *item_list, unsigned char response)
{
#if PACKETVER >= 20131223
@@ -23437,5 +23443,5 @@ void clif_defaults(void)
clif->pReqRemainTime = clif_parse_reqRemainTime;
clif->npc_barter_open = clif_npc_barter_open;
-
+ clif->pNPCBarterClosed = clif_parse_NPCBarterClosed;
}
diff --git a/src/map/clif.h b/src/map/clif.h
index f5c9f62e8..44db8047f 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1588,6 +1588,7 @@ struct clif_interface {
bool (*enchant_equipment) (struct map_session_data *sd, enum equip_pos pos, int cardSlot, int cardId);
void (*pReqRemainTime) (int fd, struct map_session_data *sd);
void (*npc_barter_open) (struct map_session_data *sd, struct npc_data *nd);
+ void (*pNPCBarterClosed) (int fd, struct map_session_data *sd);
};
#ifdef HERCULES_CORE
diff --git a/src/map/packets.h b/src/map/packets.h
index 81b861f78..aa9f041d3 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -1922,4 +1922,8 @@ packet(0x96e,clif->ackmergeitems);
packet(0x0b19,clif->pInventoryExpansionRejected);
#endif
+#if PACKETVER_ZERO_NUM >= 20181226
+ packet(0x0b12,clif->pNPCBarterClosed);
+#endif
+
#endif /* MAP_PACKETS_H */
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 1e11eadd7..82ae82eaf 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -3084,6 +3084,13 @@ struct PACKET_ZC_NPC_BARTER_OPEN {
DEFINE_PACKET_HEADER(ZC_NPC_BARTER_OPEN, 0x0b0e);
#endif
+#if PACKETVER_ZERO_NUM >= 20181226
+struct PACKET_CZ_NPC_BARTER_CLOSE {
+ int16 packetType;
+} __attribute__((packed));
+DEFINE_PACKET_HEADER(CZ_NPC_BARTER_CLOSE, 0x0b12);
+#endif
+
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris