summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/rodex.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 7edc1ec5a..17faf02c8 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -19310,7 +19310,7 @@ void clif_parse_rodex_open_write_mail(int fd, struct map_session_data *sd) __att
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() == true) ? 1 : 0;
+ int8 result = (rodex->isenabled() == true && sd->npc_id == 0) ? 1 : 0;
clif->rodex_open_write_mail(fd, rPacket->receiveName, result);
}
diff --git a/src/map/rodex.c b/src/map/rodex.c
index dcecb6b8f..02e757a10 100644
--- a/src/map/rodex.c
+++ b/src/map/rodex.c
@@ -231,6 +231,11 @@ int rodex_send_mail(struct map_session_data *sd, const char *receiver_name, cons
nullpo_retr(RODEX_SEND_MAIL_FATAL_ERROR, body);
nullpo_retr(RODEX_SEND_MAIL_FATAL_ERROR, title);
+ if (!rodex->isenabled() || sd->npc_id > 0) {
+ rodex->clean(sd, 1);
+ return RODEX_SEND_MAIL_FATAL_ERROR;
+ }
+
if (zeny < 0) {
rodex->clean(sd, 1);
return RODEX_SEND_MAIL_FATAL_ERROR;