summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-03-24 23:58:51 +0000
committerbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-03-24 23:58:51 +0000
commit7fcfa0156e480cb0086ead412698dad5708e23a8 (patch)
treee0854a4fa39f0f03d9b7fb1c9c8c6bb81254d38a /src
parentfbb2cecd2f8fbdf6fa212f157fa7d946e6751a79 (diff)
downloadhercules-7fcfa0156e480cb0086ead412698dad5708e23a8.tar.gz
hercules-7fcfa0156e480cb0086ead412698dad5708e23a8.tar.bz2
hercules-7fcfa0156e480cb0086ead412698dad5708e23a8.tar.xz
hercules-7fcfa0156e480cb0086ead412698dad5708e23a8.zip
- Changed mail_setattachment() to fail if you are OVER 100% overweight.
This prevents item loss if the send mail fails. (bugreport:4144) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14271 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/mail.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map/mail.c b/src/map/mail.c
index 2b0dcb3cb..d2dce6f17 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -120,6 +120,9 @@ bool mail_setattachment(struct map_session_data *sd, struct mail_message *msg)
if( sd->status.inventory[n].amount < sd->mail.amount )
return false;
+ if( sd->weight > sd->max_weight )
+ return false;
+
memcpy(&msg->item, &sd->status.inventory[n], sizeof(struct item));
msg->item.amount = sd->mail.amount;
}