From 7496915ff909733618b011ca06ee27ae7a098f2b Mon Sep 17 00:00:00 2001 From: zephyrus Date: Wed, 7 Nov 2007 17:16:53 +0000 Subject: - Some updates on the mail system packets [Zephyrus] - Corrected the mail database structure on main.sql - TODO: find what happens when you cannot receive an emailed item due to weight problems. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11692 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/intif.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/map/intif.c') diff --git a/src/map/intif.c b/src/map/intif.c index 629f1f5d1..d54441f4e 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1700,17 +1700,9 @@ static void intif_parse_Mail_send(int fd) fail = true; else { - if( sd == NULL ) - fail = true; + fail = !mail_checkattach(sd); - if( !mail_checkattach(sd) ) - { - mail_removeitem(sd, 0); - mail_removezeny(sd, 0); - fail = true; - } - - // confirmation message + // Confirmation to CharServer WFIFOHEAD(inter_fd,7); WFIFOW(inter_fd,0) = 0x304e; WFIFOL(inter_fd,2) = mail_id; @@ -1718,6 +1710,14 @@ static void intif_parse_Mail_send(int fd) WFIFOSET(inter_fd,7); } + nullpo_retv(sd); + + if( fail ) + { // Return items and zeny to owner + mail_removeitem(sd, 0); + mail_removezeny(sd, 0); + } + clif_Mail_send(sd->fd, fail); } -- cgit v1.2.3-60-g2f50