* 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
This commit is contained in:
ai4rei 2011-04-05 08:14:54 +00:00
parent bf12d754cc
commit 202bdda8d5
2 changed files with 10 additions and 2 deletions

View File

@ -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

View File

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