summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-03 22:25:57 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-03 22:25:57 +0000
commit79b36cc86e1c1c596e1b23874f2c5acf947807bc (patch)
tree257067623f2e8258e8d444a7ec795899b2e770f1 /src
parent0dd21624a69cf05d3c25f4d76500b3d8366a5c62 (diff)
downloadhercules-79b36cc86e1c1c596e1b23874f2c5acf947807bc.tar.gz
hercules-79b36cc86e1c1c596e1b23874f2c5acf947807bc.tar.bz2
hercules-79b36cc86e1c1c596e1b23874f2c5acf947807bc.tar.xz
hercules-79b36cc86e1c1c596e1b23874f2c5acf947807bc.zip
- Added a fix to prevent missing a mail attachment is map servers disconnect from char server.
- Fixed the sprite of Wing of Victory. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11855 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c3
-rw-r--r--src/map/intif.c15
-rw-r--r--src/map/mail.c16
-rw-r--r--src/map/mail.h1
4 files changed, 23 insertions, 12 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 5d2413acd..1fec3b602 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11515,7 +11515,8 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd)
memset(msg.body, 0x00, MAIL_BODY_LENGTH);
msg.timestamp = (int)mail_calctimes();
- intif_Mail_send(sd->status.account_id, &msg);
+ if( !intif_Mail_send(sd->status.account_id, &msg) )
+ mail_deliveryfail(sd, &msg);
sd->cansendmail_tick = gettick() + 1000; // 1 Second flood Protection
}
diff --git a/src/map/intif.c b/src/map/intif.c
index 1cecf5ab0..72766c471 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -1645,7 +1645,7 @@ int intif_Mail_send(int account_id, struct mail_message *msg)
memcpy(WFIFOP(inter_fd,8), msg, sizeof(struct mail_message));
WFIFOSET(inter_fd,len);
- return 0;
+ return 1;
}
static void intif_parse_Mail_send(int fd)
@@ -1666,16 +1666,9 @@ static void intif_parse_Mail_send(int fd)
if( (sd = map_charid2sd(msg.send_id)) )
{
if( fail )
- {
- pc_additem(sd, &msg.item, msg.item.amount);
- if( msg.zeny > 0 )
- {
- sd->status.zeny += msg.zeny;
- clif_updatestatus(sd, SP_ZENY);
- }
- }
-
- clif_Mail_send(sd->fd, fail);
+ mail_deliveryfail(sd, &msg);
+ else
+ clif_Mail_send(sd->fd, false);
}
if( fail )
diff --git a/src/map/mail.c b/src/map/mail.c
index 9d2f4375e..a08d04c0d 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -154,4 +154,20 @@ int mail_openmail(struct map_session_data *sd)
return 0;
}
+void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
+{
+ nullpo_retv(sd);
+ nullpo_retv(msg);
+
+ pc_additem(sd, &msg->item, msg->item.amount);
+
+ if( msg->zeny > 0 )
+ {
+ sd->status.zeny += msg->zeny;
+ clif_updatestatus(sd, SP_ZENY);
+ }
+
+ clif_Mail_send(sd->fd, true);
+}
+
#endif
diff --git a/src/map/mail.h b/src/map/mail.h
index 1079fc560..bea33d3af 100644
--- a/src/map/mail.h
+++ b/src/map/mail.h
@@ -14,5 +14,6 @@ unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount);
bool mail_setattachment(struct map_session_data *sd, struct mail_message *msg);
void mail_getattachment(struct map_session_data* sd, int zeny, struct item* item);
int mail_openmail(struct map_session_data *sd);
+void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg);
#endif /* _MAIL_H_ */