summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-09 21:24:46 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:24 +0300
commit364c8c276f870629f5c0b992884af9131234089c (patch)
tree96d4cbd2151467b7c713a6ede3339f73b15d0e43
parent2cc9165b429a312b36110ca14b2d1009c41dfb97 (diff)
downloadhercules-364c8c276f870629f5c0b992884af9131234089c.tar.gz
hercules-364c8c276f870629f5c0b992884af9131234089c.tar.bz2
hercules-364c8c276f870629f5c0b992884af9131234089c.tar.xz
hercules-364c8c276f870629f5c0b992884af9131234089c.zip
Move packet ZC_ACK_OPENSTORE2 into separate function.
-rw-r--r--src/map/clif.c15
-rw-r--r--src/map/clif.h1
2 files changed, 13 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 53a437d05..6b89985e3 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -6625,11 +6625,19 @@ static void clif_openvending(struct map_session_data *sd, int id, struct s_vendi
}
WFIFOSET(fd, len);
+ clif->openvendingAck(fd, 0);
+}
+
+// 0 - open vending success
+// 1 - message MSG_MERCHANTSHOP_MAKING_FAIL
+// 2 - silent ignore
+// 3 - message MSG_ID_C9D (You can not open a stall at the current location)
+static void clif_openvendingAck(int fd, int result)
+{
#if PACKETVER >= 20140625
- /** should go elsewhere perhaps? it has to be bundled with this however. **/
WFIFOHEAD(fd, packet_len(0xa28));
- WFIFOW(fd, 0) = 0xa28;
- WFIFOB(fd, 2) = 0;/** 1 is failure. our current responses to failure are working so not yet implemented **/
+ WFIFOW(fd, 0) = 0xa28; // ZC_ACK_OPENSTORE2
+ WFIFOB(fd, 2) = result;
WFIFOSET(fd, packet_len(0xa28));
#endif
}
@@ -21870,6 +21878,7 @@ void clif_defaults(void)
clif->vendinglist = clif_vendinglist;
clif->buyvending = clif_buyvending;
clif->openvending = clif_openvending;
+ clif->openvendingAck = clif_openvendingAck;
clif->vendingreport = clif_vendingreport;
/* storage handling */
clif->storagelist = clif_storagelist;
diff --git a/src/map/clif.h b/src/map/clif.h
index a60a09852..c58297c5c 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -974,6 +974,7 @@ struct clif_interface {
void (*vendinglist) (struct map_session_data* sd, unsigned int id, struct s_vending* vending_list);
void (*buyvending) (struct map_session_data* sd, int index, int amount, int fail);
void (*openvending) (struct map_session_data* sd, int id, struct s_vending* vending_list);
+ void (*openvendingAck) (int fd, int result);
void (*vendingreport) (struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny);
/* storage handling */
void (*storagelist) (struct map_session_data* sd, struct item* items, int items_length);