summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-08-04 21:02:36 +0300
committerAndrei Karas <akaras@inbox.ru>2018-08-22 06:33:28 +0300
commite73bc865155c275994d24a87e54b7e5ae327493d (patch)
treec090791876d40e567622d20e2761206d91905558 /src/map/clif.c
parent742947960df6c2d1fc7ba8c2859b42966e9d22b7 (diff)
downloadhercules-e73bc865155c275994d24a87e54b7e5ae327493d.tar.gz
hercules-e73bc865155c275994d24a87e54b7e5ae327493d.tar.bz2
hercules-e73bc865155c275994d24a87e54b7e5ae327493d.tar.xz
hercules-e73bc865155c275994d24a87e54b7e5ae327493d.zip
Split packet CZ_REQ_STYLE_CHANGE to CZ_REQ_STYLE_CHANGE and CZ_REQ_STYLE_CHANGE2.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 4e8e84f41..dfb6aae06 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -21548,13 +21548,32 @@ static void clif_parse_cz_req_style_change(int fd, struct map_session_data *sd)
clif->cz_req_style_change_sub(sd, LOOK_HEAD_MID, p->MidAccessory, true);
if (p->BottomAccessory > 0)
clif->cz_req_style_change_sub(sd, LOOK_HEAD_BOTTOM, p->BottomAccessory, true);
-#if PACKETVER_RE_NUM >= 20180718
+ clif->style_change_response(sd, STYLIST_SHOP_SUCCESS);
+ return;
+}
+
+static void clif_parse_cz_req_style_change2(int fd, struct map_session_data *sd) __attribute__((nonnull(2)));
+static void clif_parse_cz_req_style_change2(int fd, struct map_session_data *sd)
+{
+ const struct PACKET_CZ_REQ_STYLE_CHANGE2 *p = RP2PTR(fd);
+
+ if (p->HeadStyle > 0)
+ clif->cz_req_style_change_sub(sd, LOOK_HAIR, p->HeadStyle, false);
+ if (p->HeadPalette > 0)
+ clif->cz_req_style_change_sub(sd, LOOK_HAIR_COLOR, p->HeadPalette, false);
+ if (p->BodyPalette > 0)
+ clif->cz_req_style_change_sub(sd, LOOK_CLOTHES_COLOR, p->BodyPalette, false);
+ if (p->TopAccessory > 0)
+ clif->cz_req_style_change_sub(sd, LOOK_HEAD_TOP, p->TopAccessory, true);
+ if (p->MidAccessory > 0)
+ clif->cz_req_style_change_sub(sd, LOOK_HEAD_MID, p->MidAccessory, true);
+ if (p->BottomAccessory > 0)
+ clif->cz_req_style_change_sub(sd, LOOK_HEAD_BOTTOM, p->BottomAccessory, true);
if (p->BodyStyle > 0) {
if (pc->has_second_costume(sd)) {
clif->cz_req_style_change_sub(sd, LOOK_BODY2, p->BodyStyle, false);
}
}
-#endif
clif->style_change_response(sd, STYLIST_SHOP_SUCCESS);
return;
}
@@ -22775,6 +22794,7 @@ void clif_defaults(void)
clif->style_change_validate_requirements = clif_style_change_validate_requirements;
clif->stylist_send_rodexitem = clif_stylist_send_rodexitem;
clif->pReqStyleChange = clif_parse_cz_req_style_change;
+ clif->pReqStyleChange2 = clif_parse_cz_req_style_change2;
clif->cz_req_style_change_sub = clif_cz_req_style_change_sub;
clif->style_change_response = clif_style_change_response;