Selaa lähdekoodia

* Paying and obtaining Zeny (pc_payzeny/pc_getzeny) no longer silently reverses the effect for negative amounts, that is, getting Zeny instead of paying up and vice versa (since r8273, related r8072).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14766 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 vuotta sitten
vanhempi
commit
202bdda8d5
2 muutettua tiedostoa jossa 10 lisäystä ja 2 poistoa
  1. 2 0
      Changelog-Trunk.txt
  2. 8 2
      src/map/pc.c

+ 2 - 0
Changelog-Trunk.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2011/04/05
+	* Paying and obtaining Zeny (pc_payzeny/pc_getzeny) no longer silently reverses the effect for negative amounts, that is, getting Zeny instead of paying up and vice versa (since r8273, related r8072). [Ai4rei]
 2011/03/29
 	* Added TargetName values to VS2010 project files to prevent MSB8012 warnings (follow-up to r14562). [Gepard]
 2011/03/28

+ 8 - 2
src/map/pc.c

@@ -3245,7 +3245,10 @@ int pc_payzeny(struct map_session_data *sd,int zeny)
 	nullpo_ret(sd);
 
 	if( zeny < 0 )
-	  	return pc_getzeny(sd, -zeny);
+	{
+		ShowError("pc_payzeny: Paying negative Zeny (zeny=%d, account_id=%d, char_id=%d).\n", zeny, sd->status.account_id, sd->status.char_id);
+		return 1;
+	}
 
 	if( sd->status.zeny < zeny )
 		return 1; //Not enough.
@@ -3301,7 +3304,10 @@ int pc_getzeny(struct map_session_data *sd,int zeny)
 	nullpo_ret(sd);
 
 	if( zeny < 0 )
-		return pc_payzeny(sd, -zeny);
+	{
+		ShowError("pc_getzeny: Obtaining negative Zeny (zeny=%d, account_id=%d, char_id=%d).\n", zeny, sd->status.account_id, sd->status.char_id);
+		return 1;
+	}
 
 	if( zeny > MAX_ZENY - sd->status.zeny )
 		zeny = MAX_ZENY - sd->status.zeny;