From e2f3dc61d7f2720f80d247354604b1ebdc15aad6 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sun, 16 Aug 2009 19:48:10 -0600 Subject: Prevent buying more items than you can carry --- src/map/npc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/map/npc.c b/src/map/npc.c index 4e444b1..a24a458 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -944,7 +944,10 @@ int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list) case ADDITEM_EXIST: break; case ADDITEM_NEW: - new++; + if (itemdb_isequip) + new += item_list[i*2]; + else + new++; break; case ADDITEM_OVERAMOUNT: return 2; @@ -952,6 +955,7 @@ int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list) w+=itemdb_weight(item_list[i*2+1]) * item_list[i*2]; } + if (z > (double)sd->status.zeny) return 1; // zeny�s�� if (w+sd->weight > sd->max_weight) -- cgit v1.2.3-70-g09d2