summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorDennis Friis <peavey@placid.dk>2008-04-02 20:32:07 +0000
committerDennis Friis <peavey@placid.dk>2008-04-02 20:32:07 +0000
commitbb016715519445a919c79fb6506d9ef6b6268b88 (patch)
treecde1d213c6427e9e8936fc77dccc0ed311ea1f53 /src/map/npc.c
parentb30d349b7b761e9ec32e908027c1b32e4ba0869b (diff)
downloadtmwa-bb016715519445a919c79fb6506d9ef6b6268b88.tar.gz
tmwa-bb016715519445a919c79fb6506d9ef6b6268b88.tar.bz2
tmwa-bb016715519445a919c79fb6506d9ef6b6268b88.tar.xz
tmwa-bb016715519445a919c79fb6506d9ef6b6268b88.zip
Fix so you cant sell/buy from NPC SHOP while in a trade
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 05a5dc4..2029321 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -986,6 +986,8 @@ int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list)
return 2; // 重量超過
if (pc_inventoryblank(sd)<new)
return 3; // 種類数超過
+ if (sd->trade_partner != 0)
+ return 4; // cant buy while trading
pc_payzeny(sd,(int)z);
for(i=0;i<n;i++) {
@@ -1039,6 +1041,8 @@ int npc_selllist(struct map_session_data *sd,int n,unsigned short *item_list)
if (nameid == 0 ||
sd->status.inventory[item_list[i*2]-2].amount < item_list[i*2+1])
return 1;
+ if (sd->trade_partner != 0)
+ return 2;
if (itemdb_value_notoc(nameid))
z+=(double)itemdb_value_sell(nameid) * item_list[i*2+1];
else