소스 검색

- 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;
 	}