diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-06-13 05:27:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-06-14 22:12:11 +0300 |
commit | ef8ee07753bfbf824e57eafc617acc7d921c0f38 (patch) | |
tree | 1847cbd76c70107e03cdd413cb55a97bfe329074 /src/map/clif.c | |
parent | fddfde994fe98843db6802f438a5f23941836642 (diff) | |
download | hercules-ef8ee07753bfbf824e57eafc617acc7d921c0f38.tar.gz hercules-ef8ee07753bfbf824e57eafc617acc7d921c0f38.tar.bz2 hercules-ef8ee07753bfbf824e57eafc617acc7d921c0f38.tar.xz hercules-ef8ee07753bfbf824e57eafc617acc7d921c0f38.zip |
Split enum zc_ui_types by supported packet versions.
Also fixed clif_open_ui for old clients.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 9be4feb70..a9d82b1ac 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -20533,34 +20533,41 @@ void clif_parse_open_ui_request(int fd, struct map_session_data *sd) void clif_open_ui(struct map_session_data *sd, enum cz_ui_types uiType) { -#if PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411 - int claimed = 0; +#if PACKETVER >= 20150128 struct PACKET_ZC_OPEN_UI p; nullpo_retv(sd); - p.PacketType = 0xAE2; + p.PacketType = openUiType; switch (uiType) { case CZ_STYLIST_UI: - p.UIType = STYLIST_UI; + p.UIType = ZC_STYLIST_UI; +#if PACKETVER >= 20171122 p.data = 0; +#endif break; case CZ_ATTENDANCE_UI: + { +#if PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411 + int claimed = 0; if (clif->attendance_timediff(sd) != true) ++claimed; else if (sd->status.attendance_count >= VECTOR_LENGTH(clif->attendance_data)) sd->status.attendance_count = 0; p.UIType = ZC_ATTENDANCE_UI; p.data = sd->status.attendance_count * 10 + claimed; +#else + ShowWarning("Attendance System available only for PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411.\n"); + return; +#endif break; + } default: - ShowWarning("clif_open_ui: Requested UI (%d) is not implemented yet.\n", uiType); + ShowWarning("clif_open_ui: Requested UI (%u) is not implemented yet.\n", uiType); return; } clif->send(&p, sizeof(p), &sd->bl, SELF); -#else - ShowWarning("Attendance System available only for PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411.\n"); #endif } |