summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-12-14 00:16:13 +0300
committerAndrei Karas <akaras@inbox.ru>2018-12-14 22:05:09 +0300
commit392c598c6ee3ce9e10eec9e44d6c2f93d4dae232 (patch)
treeb70718d679de8cc343412b55a89ece903c52be49 /src/map
parent60a03815c37f04485c048bb3e4f37960b6ba18cb (diff)
downloadhercules-392c598c6ee3ce9e10eec9e44d6c2f93d4dae232.tar.gz
hercules-392c598c6ee3ce9e10eec9e44d6c2f93d4dae232.tar.bz2
hercules-392c598c6ee3ce9e10eec9e44d6c2f93d4dae232.tar.xz
hercules-392c598c6ee3ce9e10eec9e44d6c2f93d4dae232.zip
Add packet CZ_INVENTORY_EXPAND_CONFIRMED
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c17
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/packets.h1
-rw-r--r--src/map/packets_struct.h7
4 files changed, 26 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 10f6f0bdc..a9fc3be74 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3123,6 +3123,22 @@ static void clif_parse_inventoryExpansion(int fd, struct map_session_data *sd)
#endif
}
+static void clif_parse_inventoryExpansionConfirmed(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+static void clif_parse_inventoryExpansionConfirmed(int fd, struct map_session_data *sd)
+{
+#if PACKETVER_MAIN_NUM >= 20181031 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20181114
+ char evname[EVENT_NAME_LENGTH];
+ struct event_data *ev = NULL;
+
+ safestrncpy(evname, "inventory_expansion::OnInvExpandConfirmed", EVENT_NAME_LENGTH);
+ if ((ev = strdb_get(npc->ev_db, evname))) {
+ script->run_npc(ev->nd->u.scr.script, ev->pos, sd->bl.id, ev->nd->bl.id);
+ } else {
+ ShowError("clif_parse_inventoryExpansionConfirmed: event '%s' not found, operation failed.\n", evname);
+ }
+#endif
+}
+
/// Removes cart (ZC_CARTOFF).
/// 012b
/// Client behavior:
@@ -22592,6 +22608,7 @@ void clif_defaults(void)
clif->inventoryExpandAck = clif_inventoryExpandAck;
clif->inventoryExpandResult = clif_inventoryExpandResult;
clif->pInventoryExpansion = clif_parse_inventoryExpansion;
+ clif->pInventoryExpansionConfirmed = clif_parse_inventoryExpansionConfirmed;
clif->favorite_item = clif_favorite_item;
clif->clearcart = clif_clearcart;
clif->item_identify_list = clif_item_identify_list;
diff --git a/src/map/clif.h b/src/map/clif.h
index 7993429a1..6e743e57f 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -871,6 +871,7 @@ struct clif_interface {
void (*inventoryExpandAck) (struct map_session_data *sd, enum expand_inventory result, int itemId);
void (*inventoryExpandResult) (struct map_session_data *sd, enum expand_inventory_result result);
void (*pInventoryExpansion) (int fd, struct map_session_data *sd);
+ void (*pInventoryExpansionConfirmed) (int fd, struct map_session_data *sd);
void (*favorite_item) (struct map_session_data* sd, unsigned short index);
void (*clearcart) (int fd);
void (*item_identify_list) (struct map_session_data *sd);
diff --git a/src/map/packets.h b/src/map/packets.h
index 4e81b3bf3..bad3aa915 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -1912,6 +1912,7 @@ packet(0x96e,clif->ackmergeitems);
#if PACKETVER_MAIN_NUM >= 20181031 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20181114
packet(0x0b14,clif->pInventoryExpansion);
+ packet(0x0b16,clif->pInventoryExpansionConfirmed);
#endif
#endif /* MAP_PACKETS_H */
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index ad67091dc..ea385963c 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -3013,6 +3013,13 @@ struct PACKET_CZ_INVENTORY_EXPAND {
DEFINE_PACKET_HEADER(CZ_INVENTORY_EXPAND, 0x0b14);
#endif
+#if PACKETVER_MAIN_NUM >= 20181031 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20181114
+struct PACKET_CZ_INVENTORY_EXPAND_CONFIRMED {
+ int16 packetType;
+} __attribute__((packed));
+DEFINE_PACKET_HEADER(CZ_INVENTORY_EXPAND_CONFIRMED, 0x0b16);
+#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