Explorar el Código

Fixed bug that allowed a auction bid to fail (and generate zeny loss) if made while no char server is present.
Added @showzeny tracking to pc_payzeny so that it's messages are more consistent when zeny is earned/reduced. credit to gepard for his concept
both from bugreport:1138

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

shennetsind hace 13 años
padre
commit
76253a7cad
Se han modificado 2 ficheros con 13 adiciones y 8 borrados
  1. 4 4
      src/map/clif.c
  2. 9 4
      src/map/pc.c

+ 4 - 4
src/map/clif.c

@@ -14150,8 +14150,7 @@ void clif_parse_Auction_bid(int fd, struct map_session_data *sd)
 	unsigned int auction_id = RFIFOL(fd,2);
 	int bid = RFIFOL(fd,6);
 
-	if( !pc_can_give_items(pc_isGM(sd)) )
-	{ //They aren't supposed to give zeny [Inkfish]
+	if( !pc_can_give_items(pc_isGM(sd)) ) { //They aren't supposed to give zeny [Inkfish]
 		clif_displaymessage(sd->fd, msg_txt(246));
 		return;
 	}
@@ -14160,8 +14159,9 @@ void clif_parse_Auction_bid(int fd, struct map_session_data *sd)
 		clif_Auction_message(fd, 0); // You have failed to bid into the auction
 	else if( bid > sd->status.zeny )
 		clif_Auction_message(fd, 8); // You do not have enough zeny
-	else
-	{
+	else if ( CheckForCharServer() ) // char server is down (bugreport:1138)
+		clif_Auction_message(fd, 0); // You have failed to bid into the auction
+	else {
 		pc_payzeny(sd, bid);
 		intif_Auction_bid(sd->status.char_id, sd->status.name, auction_id, bid);
 	}

+ 9 - 4
src/map/pc.c

@@ -3373,7 +3373,7 @@ int pc_inventoryblank(struct map_session_data *sd)
 }
 
 /*==========================================
- * ‚¨‹à‚ð?‚¤
+ * attempts to remove zeny from player (sd)
  *------------------------------------------*/
 int pc_payzeny(struct map_session_data *sd,int zeny)
 {
@@ -3391,6 +3391,12 @@ int pc_payzeny(struct map_session_data *sd,int zeny)
 	sd->status.zeny -= zeny;
 	clif_updatestatus(sd,SP_ZENY);
 
+	if( zeny > 0 && sd->state.showzeny ) {
+		char output[255];
+		sprintf(output, "Removed %dz.", zeny);
+		clif_disp_onlyself(sd,output,strlen(output));
+	}
+
 	return 0;
 }
 /*==========================================
@@ -3482,7 +3488,7 @@ void pc_getcash(struct map_session_data *sd, int cash, int points)
 }
 
 /*==========================================
- * ‚¨‹à‚𓾂é
+ * Attempts to give zeny to player (sd)
  *------------------------------------------*/
 int pc_getzeny(struct map_session_data *sd,int zeny)
 {
@@ -3500,8 +3506,7 @@ int pc_getzeny(struct map_session_data *sd,int zeny)
 	sd->status.zeny += zeny;
 	clif_updatestatus(sd,SP_ZENY);
 
-	if( zeny > 0 && sd->state.showzeny )
-	{
+	if( zeny > 0 && sd->state.showzeny ) {
 		char output[255];
 		sprintf(output, "Gained %dz.", zeny);
 		clif_disp_onlyself(sd,output,strlen(output));