瀏覽代碼

- 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 年之前
父節點
當前提交
4213c1bc95
共有 1 個文件被更改,包括 3 次插入0 次删除
  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;
 	}