summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-13 07:03:07 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:29 +0300
commit83c26fc34c8ae4badc06b3ff41fa528033a5c840 (patch)
tree47de0f3872fb47ac9072439ddbc36b52f8a661e5 /src
parent94103275452a7272205a1f154a67e435cdb0584f (diff)
downloadhercules-83c26fc34c8ae4badc06b3ff41fa528033a5c840.tar.gz
hercules-83c26fc34c8ae4badc06b3ff41fa528033a5c840.tar.bz2
hercules-83c26fc34c8ae4badc06b3ff41fa528033a5c840.tar.xz
hercules-83c26fc34c8ae4badc06b3ff41fa528033a5c840.zip
Do attendace check only if packet requested open attendance ui (closes #2129).
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 4c3855914..c4a401fa7 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -20966,18 +20966,8 @@ static time_t clif_attendance_getendtime(void)
static void clif_parse_open_ui_request(int fd, struct map_session_data *sd) __attribute__((nonnull(2)));
static void clif_parse_open_ui_request(int fd, struct map_session_data *sd)
{
-
const struct PACKET_CZ_OPEN_UI *p = RP2PTR(fd);
- if (clif->attendance_getendtime() < time(NULL)) {
-#if PACKETVER >= 20180207
- clif->msgtable_color(sd, MSG_ATTENDANCE_UNAVAILABLE, COLOR_RED);
-#endif
- return;
- }
-
- if (battle_config.feature_enable_attendance_system != 1)
- return;
clif->open_ui(sd, p->UIType);
}
@@ -20986,6 +20976,9 @@ static void clif_open_ui(struct map_session_data *sd, enum cz_ui_types uiType)
{
#if PACKETVER >= 20150128
struct PACKET_ZC_OPEN_UI p;
+#if PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411
+ int claimed = 0;
+#endif
nullpo_retv(sd);
@@ -20999,8 +20992,15 @@ static void clif_open_ui(struct map_session_data *sd, enum cz_ui_types uiType)
break;
case CZ_ATTENDANCE_UI:
{
+ if (clif->attendance_getendtime() < time(NULL)) {
+#if PACKETVER >= 20180207
+ clif->msgtable_color(sd, MSG_ATTENDANCE_UNAVAILABLE, COLOR_RED);
+#endif
+ return;
+ }
+ if (battle_config.feature_enable_attendance_system != 1)
+ return;
#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))