Browse Source

- 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://svn.code.sf.net/p/rathena/svn/trunk@14271 54d463be-8e91-2dee-dedb-b68131a5f0ec

brianluau 15 years ago
parent
commit
4213c1bc95
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/map/mail.c

+ 3 - 0
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;
 	}