summaryrefslogtreecommitdiff
path: root/src/map/mail.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mail.c')
-rw-r--r--src/map/mail.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/map/mail.c b/src/map/mail.c
index 70c73c0a4..62d046ea4 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -48,9 +48,7 @@ int mail_removezeny(struct map_session_data *sd, short flag)
if (flag && sd->mail.zeny > 0)
{ //Zeny send
- log_zeny(sd, LOG_TYPE_MAIL, sd, -sd->mail.zeny);
-
- sd->status.zeny -= sd->mail.zeny;
+ pc_payzeny(sd,sd->mail.zeny,LOG_TYPE_MAIL, NULL);
}
sd->mail.zeny = 0;
clif_updatestatus(sd, SP_ZENY);
@@ -59,10 +57,10 @@ int mail_removezeny(struct map_session_data *sd, short flag)
}
unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) {
-
+
if( pc_istrading(sd) )
return 1;
-
+
if( idx == 0 ) { // Zeny Transfer
if( amount < 0 || !pc_can_give_items(sd) )
return 1;
@@ -88,7 +86,7 @@ unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) {
sd->mail.index = idx;
sd->mail.nameid = sd->status.inventory[idx].nameid;
sd->mail.amount = amount;
-
+
return 0;
}
}
@@ -96,7 +94,7 @@ 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)
{
int n;
-
+
nullpo_retr(false,sd);
nullpo_retr(false,msg);
@@ -140,8 +138,7 @@ void mail_getattachment(struct map_session_data* sd, int zeny, struct item* item
if( zeny > 0 )
{ //Zeny receive
- log_zeny(sd, LOG_TYPE_MAIL, sd, zeny);
- pc_getzeny(sd, zeny);
+ pc_getzeny(sd, zeny,LOG_TYPE_MAIL, NULL);
}
}
@@ -170,13 +167,9 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
if( msg->zeny > 0 )
{
- //Zeny receive (due to failure)
- log_zeny(sd, LOG_TYPE_MAIL, sd, msg->zeny);
-
- sd->status.zeny += msg->zeny;
- clif_updatestatus(sd, SP_ZENY);
+ pc_getzeny(sd,msg->zeny,LOG_TYPE_MAIL, NULL); //Zeny receive (due to failure)
}
-
+
clif_Mail_send(sd->fd, true);
}