From 1ee5255bc81b5057dae57f4f1d91b7c70efeb143 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Thu, 25 Jun 2020 08:20:50 +0200 Subject: Disable using Megaphone while Rodex send mail window is present This also fixes the issue where the client freezes when talking to a NPC while Rodex send mail window is present. --- src/map/clif.c | 3 +++ src/map/pc.c | 9 +++++++++ src/map/rodex.c | 1 + 3 files changed, 13 insertions(+) diff --git a/src/map/clif.c b/src/map/clif.c index f347a379a..fa01d31b5 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -22190,6 +22190,9 @@ static void clif_parse_rodex_open_write_mail(int fd, struct map_session_data *sd const struct PACKET_CZ_REQ_OPEN_WRITE_MAIL *rPacket = RFIFOP(fd, 0); int8 result = (rodex->isenabled() && (sd->npc_id == 0 || sd->state.using_megaphone != 0)) ? 1 : 0; + if (result == 1) + sd->state.workinprogress |= 2; + clif->rodex_open_write_mail(fd, rPacket->receiveName, result); } diff --git a/src/map/pc.c b/src/map/pc.c index 085b7c6bb..63d62467c 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5190,6 +5190,15 @@ static int pc_useitem(struct map_session_data *sd, int n) // Store information for later use before it is lost (via pc->delitem) [Paradox924X] nameid = sd->inventory_data[n]->nameid; + if (nameid == ITEMID_MEGAPHONE && (sd->state.workinprogress & 2) != 0) { +#if PACKETVER >= 20110308 + clif->msgtable(sd, MSG_BUSY); +#else + clif->messagecolor_self(sd->fd, COLOR_WHITE, msg_sd(sd, 48)); +#endif + return 0; + } + if (nameid != ITEMID_NAUTHIZ && sd->sc.opt1 > 0 && sd->sc.opt1 != OPT1_STONEWAIT && sd->sc.opt1 != OPT1_BURNING) return 0; diff --git a/src/map/rodex.c b/src/map/rodex.c index 998066eca..f2bb8a0d4 100644 --- a/src/map/rodex.c +++ b/src/map/rodex.c @@ -575,6 +575,7 @@ static void rodex_clean(struct map_session_data *sd, int8 flag) if (flag == 0) VECTOR_CLEAR(sd->rodex.messages); + sd->state.workinprogress &= ~2; memset(&sd->rodex.tmp, 0x0, sizeof(sd->rodex.tmp)); } -- cgit v1.2.3-60-g2f50