summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-12-27 22:51:05 +0300
committerAndrei Karas <akaras@inbox.ru>2020-01-09 09:37:39 +0300
commitd26dd0680197754a97e86e9fb7146e13460fa355 (patch)
tree2cb00914150f0b011ddec1ecefd39687bbb44025 /src/map/clif.c
parente0ea615fce928b8385afa501add1c3c67ce6f9f3 (diff)
downloadhercules-d26dd0680197754a97e86e9fb7146e13460fa355.tar.gz
hercules-d26dd0680197754a97e86e9fb7146e13460fa355.tar.bz2
hercules-d26dd0680197754a97e86e9fb7146e13460fa355.tar.xz
hercules-d26dd0680197754a97e86e9fb7146e13460fa355.zip
Move packet ZC_SE_CASHSHOP_OPEN into separate function
And update to latest packet.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 31fb00c37..4adf605e1 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -19990,15 +19990,26 @@ static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd)
return;
if (map->list[sd->bl.m].flag.nocashshop) {
- clif->messagecolor_self(fd, COLOR_RED, msg_fd(fd,1489)); //Cash Shop is disabled in this map
+ clif->messagecolor_self(fd, COLOR_RED, msg_fd(fd, 1489)); //Cash Shop is disabled in this map
return;
}
- WFIFOHEAD(fd, 10);
- WFIFOW(fd, 0) = 0x845;
- WFIFOL(fd, 2) = sd->cashPoints; //[Ryuuzaki] - switched positions to reflect proper values
- WFIFOL(fd, 6) = sd->kafraPoints;
- WFIFOSET(fd, 10);
+ clif->cashShopOpen(fd, sd, 0);
+#endif
+}
+
+static void clif_cashShopOpen(int fd, struct map_session_data *sd, int tab)
+{
+#if PACKETVER_MAIN_NUM >= 20101123 || PACKETVER_RE_NUM >= 20120328 || PACKETVER_ZERO_NUM >= defined(PACKETVER_ZERO)
+ WFIFOHEAD(fd, sizeof(struct PACKET_ZC_SE_CASHSHOP_OPEN));
+ struct PACKET_ZC_SE_CASHSHOP_OPEN *p = WFIFOP(fd, 0);
+ p->packetType = HEADER_ZC_SE_CASHSHOP_OPEN;
+ p->cashPoints = sd->cashPoints; //[Ryuuzaki] - switched positions to reflect proper values
+ p->kafraPoints = sd->kafraPoints;
+#if PACKETVER_ZERO_NUM >= 20191224
+ p->tab = tab;
+#endif
+ WFIFOSET(fd, sizeof(struct PACKET_ZC_SE_CASHSHOP_OPEN));
#endif
}
@@ -24621,6 +24632,7 @@ void clif_defaults(void)
clif->pCashShopSchedule = clif_parse_CashShopSchedule;
clif->pCashShopBuy = clif_parse_CashShopBuy;
clif->cashShopBuyAck = clif_cashShopBuyAck;
+ clif->cashShopOpen = clif_cashShopOpen;
/* */
clif->pPartyTick = clif_parse_PartyTick;
clif->pGuildInvite2 = clif_parse_GuildInvite2;