浏览代码

- Fixed a bug allow GM with notrade to send zeny.
- Added a fix into auction system allow to direct buy or increase your own bid if you reach the 5 bids limit.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12335 54d463be-8e91-2dee-dedb-b68131a5f0ec

zephyrus 17 年之前
父节点
当前提交
0b52a40be3
共有 3 个文件被更改,包括 8 次插入7 次删除
  1. 2 2
      src/char_sql/int_auction.c
  2. 1 3
      src/map/clif.c
  3. 5 2
      src/map/mail.c

+ 2 - 2
src/char_sql/int_auction.c

@@ -415,7 +415,7 @@ static void mapif_parse_Auction_bid(int fd)
 		return;
 	}
 
-	if( auction_count(char_id, true) > 4 )
+	if( auction_count(char_id, true) > 4 && bid < auction->buynow && auction->buyer_id != char_id )
 	{
 		mapif_Auction_bid(fd, char_id, bid, 9); // You cannot place more than 5 bids at a time
 		return;
@@ -434,6 +434,7 @@ static void mapif_parse_Auction_bid(int fd)
 
 	auction->buyer_id = char_id;
 	safestrncpy(auction->buyer_name, (char*)RFIFOP(fd,16), NAME_LENGTH);
+	auction->price = bid;
 
 	if( bid >= auction->buynow )
 	{ // Automatic won the auction
@@ -447,7 +448,6 @@ static void mapif_parse_Auction_bid(int fd)
 		return;
 	}
 
-	auction->price = bid;
 	auction_save(auction);
 
 	mapif_Auction_bid(fd, char_id, 0, 1); // You have successfully bid in the auction

+ 1 - 3
src/map/clif.c

@@ -11642,9 +11642,7 @@ void clif_parse_Mail_setattach(int fd, struct map_session_data *sd)
 		return;
 
 	flag = mail_setitem(sd, idx, amount);
-
-	if (idx > 0)
-		clif_Mail_setattachment(fd,idx,flag);
+	clif_Mail_setattachment(fd,idx,flag);
 }
 
 /*------------------------------------------

+ 5 - 2
src/map/mail.c

@@ -73,11 +73,14 @@ unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount)
 {
 	if (idx == 0)
 	{ // Zeny Transfer
-		if (amount < 0)
+		if( amount < 0 )
 			return 0;
-		if (amount > sd->status.zeny)
+		if( amount > sd->status.zeny )
 			amount = sd->status.zeny;
 
+		if( !pc_can_give_items(pc_isGM(sd)) )
+			amount = 0;
+
 		sd->mail.zeny = amount;
 		clif_updatestatus(sd, SP_ZENY);
 		return 0;