summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
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);
}