소스 검색

* mail_deliveryfail no longer attempts to log (since r12910) and give items (since r11855), when there is no item attached to the mail (bugreport:3239).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14482 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 년 전
부모
커밋
3c92cf8047
2개의 변경된 파일10개의 추가작업 그리고 5개의 파일을 삭제
  1. 2 0
      Changelog-Trunk.txt
  2. 8 5
      src/map/mail.c

+ 2 - 0
Changelog-Trunk.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2010/11/22
+	* mail_deliveryfail no longer attempts to log (since r12910) and give items (since r11855), when there is no item attached to the mail (bugreport:3239). [Ai4rei]
 2010/11/21
 	* Added msinttypes (rev. 26, http://msinttypes.googlecode.com/svn/trunk/) portability framework for Visual C++ compilers (related bugreport:4059). [Ai4rei]
 	* Added 64-bit variants of the socket and buffer I/O macros. [Ai4rei]

+ 8 - 5
src/map/mail.c

@@ -175,12 +175,15 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
 	nullpo_retv(sd);
 	nullpo_retv(msg);
 
-	// Item recieve (due to failure)
-	if(log_config.enable_logs&0x2000)
-		log_pick_pc(sd, "E", msg->item.nameid, msg->item.amount, &msg->item);
+	if( msg->item.amount > 0 )
+	{
+		// Item recieve (due to failure)
+		if(log_config.enable_logs&0x2000)
+			log_pick_pc(sd, "E", msg->item.nameid, msg->item.amount, &msg->item);
+
+		pc_additem(sd, &msg->item, msg->item.amount);
+	}
 
-	pc_additem(sd, &msg->item, msg->item.amount);
-	
 	if( msg->zeny > 0 )
 	{
 		//Zeny recieve (due to failure)