diff options
author | panikon <panikon@zoho.com> | 2014-06-17 16:41:31 -0300 |
---|---|---|
committer | panikon <panikon@zoho.com> | 2014-06-17 16:41:31 -0300 |
commit | 2fb3c8551e25f0a545612edf8a57f3311af71721 (patch) | |
tree | 74de2ae13e7795994b24ce47a104416d6e7cb13c /src/map/trade.c | |
parent | 6ec9eeb0f3cf99201c8610ea2d5adaa6f158d3ae (diff) | |
download | hercules-2fb3c8551e25f0a545612edf8a57f3311af71721.tar.gz hercules-2fb3c8551e25f0a545612edf8a57f3311af71721.tar.bz2 hercules-2fb3c8551e25f0a545612edf8a57f3311af71721.tar.xz hercules-2fb3c8551e25f0a545612edf8a57f3311af71721.zip |
Removed ZENY_HACKER according to issue 295 (github)
Documented impossible_trade_check
Diffstat (limited to 'src/map/trade.c')
-rw-r--r-- | src/map/trade.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/map/trade.c b/src/map/trade.c index 8bb47e0cb..b3960bef9 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -166,11 +166,13 @@ void trade_tradeack(struct map_session_data *sd, int type) { clif->tradestart(sd, type); } -/*========================================== - * Check here hacker for duplicate item in trade - * normal client refuse to have 2 same types of item (except equipment) in same trade window - * normal client authorize only no equipped item and only from inventory - *------------------------------------------*/ +/** + * Checks if an impossible trade will occur + * Normal clients refuse to have 2 same types of item (except equipament) in the same trade window + * Normal clients authorize only no equipped items and only items from inventory + * @retval 0 The trade can continue + * @retval 1 Hack attempt + **/ int impossible_trade_check(struct map_session_data *sd) { struct item inventory[MAX_INVENTORY]; @@ -179,10 +181,8 @@ int impossible_trade_check(struct map_session_data *sd) nullpo_retr(1, sd); - if(sd->deal.zeny > sd->status.zeny) { - pc_setglobalreg(sd,script->add_str("ZENY_HACKER"),1); - return -1; - } + if( sd->deal.zeny > sd->status.zeny ) + return 1; // get inventory of player memcpy(&inventory, &sd->status.inventory, sizeof(struct item) * MAX_INVENTORY); |