summaryrefslogtreecommitdiff
path: root/src/map/mail.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mail.c')
-rw-r--r--src/map/mail.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/map/mail.c b/src/map/mail.c
index 0640fa521..b2a4697e5 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -4,8 +4,10 @@
#ifndef TXT_ONLY
#include "../common/nullpo.h"
+#include "../common/showmsg.h"
#include "mail.h"
+#include "atcommand.h"
#include "itemdb.h"
#include "clif.h"
#include "pc.h"
@@ -177,4 +179,16 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
clif_Mail_send(sd->fd, true);
}
+// This function only check if the mail operations are valid
+bool mail_invalid_operation(struct map_session_data *sd)
+{
+ if( !map[sd->bl.m].flag.town && pc_isGM(sd) < get_atcommand_level(atcommand_mail) )
+ {
+ ShowWarning("clif_parse_Mail: char '%s' trying to do invalid mail operations.\n", sd->status.name);
+ return true;
+ }
+
+ return false;
+}
+
#endif