From 90a72bc5eaae71d2ccdd4c1b6f859afb4c336fc6 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Thu, 25 Jun 2020 08:14:57 +0200 Subject: Enable sending mails while Megaphone input box is present --- src/map/clif.c | 2 +- src/map/mail.c | 4 ++-- src/map/rodex.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/map') diff --git a/src/map/clif.c b/src/map/clif.c index 96348d338..6b5e4a80e 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -22188,7 +22188,7 @@ static void clif_parse_rodex_open_write_mail(int fd, struct map_session_data *sd return; const struct PACKET_CZ_REQ_OPEN_WRITE_MAIL *rPacket = RFIFOP(fd, 0); - int8 result = (rodex->isenabled() == true && sd->npc_id == 0) ? 1 : 0; + int8 result = (rodex->isenabled() && (sd->npc_id == 0 || sd->state.using_megaphone != 0)) ? 1 : 0; clif->rodex_open_write_mail(fd, rPacket->receiveName, result); } diff --git a/src/map/mail.c b/src/map/mail.c index a1176e8fc..b862900c7 100644 --- a/src/map/mail.c +++ b/src/map/mail.c @@ -81,9 +81,9 @@ static int mail_removezeny(struct map_session_data *sd, short flag) static unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) { - nullpo_retr(1, sd); - if( pc_istrading(sd) ) + + if (pc_istrading_except_npc(sd) || (sd->npc_id != 0 && sd->state.using_megaphone == 0)) return 1; if( idx == 0 ) { // Zeny Transfer diff --git a/src/map/rodex.c b/src/map/rodex.c index 1ebed0623..998066eca 100644 --- a/src/map/rodex.c +++ b/src/map/rodex.c @@ -231,7 +231,7 @@ static int rodex_send_mail(struct map_session_data *sd, const char *receiver_nam nullpo_retr(RODEX_SEND_MAIL_FATAL_ERROR, body); nullpo_retr(RODEX_SEND_MAIL_FATAL_ERROR, title); - if (!rodex->isenabled() || sd->npc_id > 0) { + if (!rodex->isenabled() || (sd->npc_id != 0 && sd->state.using_megaphone == 0)) { rodex->clean(sd, 1); return RODEX_SEND_MAIL_FATAL_ERROR; } -- cgit v1.2.3-70-g09d2