diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-10 17:03:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-10 17:10:31 +0300 |
commit | 8fc98e3906f38b25c71b60b26bb31d0027ee02a0 (patch) | |
tree | ddc6cdaf9ff81c01033e3d390c40ce0432edafaf /src/map/clif.c | |
parent | c76aa5f4843a521b1839875bf6c139f4658bd6d1 (diff) | |
download | hercules-8fc98e3906f38b25c71b60b26bb31d0027ee02a0.tar.gz hercules-8fc98e3906f38b25c71b60b26bb31d0027ee02a0.tar.bz2 hercules-8fc98e3906f38b25c71b60b26bb31d0027ee02a0.tar.xz hercules-8fc98e3906f38b25c71b60b26bb31d0027ee02a0.zip |
Add extra checks into mail system.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index ac1052c71..9c172a2ee 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -14576,8 +14576,9 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd) sd->mail.inbox.msg[i].zeny = 0; memset(&sd->mail.inbox.msg[i].item, 0, sizeof(struct item)); - clif->mail_read(sd, mail_id); + mail->clear(sd); + clif->mail_read(sd, mail_id); intif->Mail_getattach(sd->status.char_id, mail_id); } @@ -14605,6 +14606,9 @@ void clif_parse_Mail_delete(int fd, struct map_session_data *sd) return; } + sd->mail.inbox.msg[i].zeny = 0; + memset(&sd->mail.inbox.msg[i].item, 0, sizeof(struct item)); + mail->clear(sd); intif->Mail_delete(sd->status.char_id, mail_id); } } @@ -14623,10 +14627,14 @@ void clif_parse_Mail_return(int fd, struct map_session_data *sd) return; ARR_FIND(0, MAIL_MAX_INBOX, i, sd->mail.inbox.msg[i].id == mail_id); - if( i < MAIL_MAX_INBOX && sd->mail.inbox.msg[i].send_id != 0 ) + if (i < MAIL_MAX_INBOX && sd->mail.inbox.msg[i].send_id != 0) { + sd->mail.inbox.msg[i].zeny = 0; + memset(&sd->mail.inbox.msg[i].item, 0, sizeof(struct item)); + mail->clear(sd); intif->Mail_return(sd->status.char_id, mail_id); - else + } else { clif->mail_return(sd->fd, mail_id, 1); + } } |