summaryrefslogtreecommitdiff
path: root/src/map/trade.c
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-13 06:05:37 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-13 06:05:37 +0000
commit50c1b03b8979ac793375b26867053f43e4983dc9 (patch)
tree9338d18d6af889c09a68095b558d3040b83182db /src/map/trade.c
parent11edd9bd6b905e1da203d49f0646cd9502536f1f (diff)
downloadhercules-50c1b03b8979ac793375b26867053f43e4983dc9.tar.gz
hercules-50c1b03b8979ac793375b26867053f43e4983dc9.tar.bz2
hercules-50c1b03b8979ac793375b26867053f43e4983dc9.tar.xz
hercules-50c1b03b8979ac793375b26867053f43e4983dc9.zip
update
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@550 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/trade.c')
-rw-r--r--src/map/trade.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index 9d2128690..ddb45a73b 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -142,8 +142,8 @@ void trade_tradeok(struct map_session_data *sd)
nullpo_retv(sd);
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) {
+ int idx = sd->deal_item_index[trade_i]-2;
+ if(((idx >= 0) && (sd->deal_item_amount[trade_i]>sd->status.inventory[idx].amount)) || sd->deal_item_amount[trade_i]<0) {
trade_tradecancel(sd);
return;
}