summaryrefslogtreecommitdiff
path: root/src/map/trade.c
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-23 18:54:09 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-23 18:54:09 +0000
commitac46c901463f925504b6a3872a21e64605e3db10 (patch)
tree4b7d5b9db8f19ee6d416a1524ecafb0d65744807 /src/map/trade.c
parent300facbcd059becdc8addac8a2f392452fea5fa0 (diff)
downloadhercules-ac46c901463f925504b6a3872a21e64605e3db10.tar.gz
hercules-ac46c901463f925504b6a3872a21e64605e3db10.tar.bz2
hercules-ac46c901463f925504b6a3872a21e64605e3db10.tar.xz
hercules-ac46c901463f925504b6a3872a21e64605e3db10.zip
memory bugs fixed
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1278 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/trade.c')
-rw-r--r--src/map/trade.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index 7709376fb..5219c27fa 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -220,8 +220,9 @@ void trade_tradeok(struct map_session_data *sd) {
// check items
for(trade_i = 0; trade_i < 10; trade_i++) {
- if (sd->deal_item_amount[trade_i] > sd->status.inventory[sd->deal_item_index[trade_i]-2].amount ||
- sd->deal_item_amount[trade_i] < 0) {
+ if (((sd->deal_item_index[trade_i]-2) < 0) ||
+ (sd->deal_item_amount[trade_i] > sd->status.inventory[sd->deal_item_index[trade_i]-2].amount) ||
+ (sd->deal_item_amount[trade_i] < 0)) {
trade_tradecancel(sd);
return;
}