summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-12-27 23:10:23 +0300
committerAndrei Karas <akaras@inbox.ru>2020-01-09 09:37:39 +0300
commit59404730afc7c392cfc6978da861783f947c9d1c (patch)
tree6736523c99d0a1e6db6956656489583feaf7f97d /src/map/clif.c
parentd26dd0680197754a97e86e9fb7146e13460fa355 (diff)
downloadhercules-59404730afc7c392cfc6978da861783f947c9d1c.tar.gz
hercules-59404730afc7c392cfc6978da861783f947c9d1c.tar.bz2
hercules-59404730afc7c392cfc6978da861783f947c9d1c.tar.xz
hercules-59404730afc7c392cfc6978da861783f947c9d1c.zip
Update packet CZ_SE_CASHSHOP_OPEN to latest version
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 4adf605e1..f0cc179b7 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -19982,10 +19982,9 @@ static void clif_parse_dull(int fd, struct map_session_data *sd)
return;
}
-static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd)
+static void clif_parse_CashShopOpen1(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+static void clif_parse_CashShopOpen1(int fd, struct map_session_data *sd)
{
-#if PACKETVER >= 20100824
if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd))
return;
@@ -19995,6 +19994,27 @@ static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd)
}
clif->cashShopOpen(fd, sd, 0);
+}
+
+static void clif_parse_CashShopLimitedReq(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+static void clif_parse_CashShopLimitedReq(int fd, struct map_session_data *sd)
+{
+}
+
+static void clif_parse_CashShopOpen2(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+static void clif_parse_CashShopOpen2(int fd, struct map_session_data *sd)
+{
+ if (sd->state.trading != 0 || pc_isdead(sd) || pc_isvending(sd))
+ return;
+
+ if (map->list[sd->bl.m].flag.nocashshop != 0) {
+ clif->messagecolor_self(fd, COLOR_RED, msg_fd(fd, 1489)); //Cash Shop is disabled in this map
+ return;
+ }
+
+#if PACKETVER >= 20191224
+ const struct PACKET_CZ_SE_CASHSHOP_OPEN2 *p = RFIFOP(fd, 0);
+ clif->cashShopOpen(fd, sd, p->tab);
#endif
}
@@ -24626,7 +24646,9 @@ void clif_defaults(void)
clif->pBGQueueRevokeReq = clif_parse_bgqueue_revoke_req;
clif->pBGQueueBattleBeginAck = clif_parse_bgqueue_battlebegin_ack;
/* RagExe Cash Shop [Ind/Hercules] */
- clif->pCashShopOpen = clif_parse_CashShopOpen;
+ clif->pCashShopOpen1 = clif_parse_CashShopOpen1;
+ clif->pCashShopOpen2 = clif_parse_CashShopOpen2;
+ clif->pCashShopLimitedReq = clif_parse_CashShopLimitedReq;
clif->pCashShopClose = clif_parse_CashShopClose;
clif->pCashShopReqTab = clif_parse_CashShopReqTab;
clif->pCashShopSchedule = clif_parse_CashShopSchedule;