summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-07 17:16:53 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-07 17:16:53 +0000
commit7496915ff909733618b011ca06ee27ae7a098f2b (patch)
tree4291f623b63f1d03fbb14d4cb7dc67dab70798af /src/map/intif.c
parenta78edf2b3c8b22ff202ee43261f89c42e2313657 (diff)
downloadhercules-7496915ff909733618b011ca06ee27ae7a098f2b.tar.gz
hercules-7496915ff909733618b011ca06ee27ae7a098f2b.tar.bz2
hercules-7496915ff909733618b011ca06ee27ae7a098f2b.tar.xz
hercules-7496915ff909733618b011ca06ee27ae7a098f2b.zip
- 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
Diffstat (limited to 'src/map/intif.c')
-rw-r--r--src/map/intif.c20
1 files changed, 10 insertions, 10 deletions
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);
}