diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-08-16 19:48:10 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-08-16 19:48:10 -0600 |
commit | e2f3dc61d7f2720f80d247354604b1ebdc15aad6 (patch) | |
tree | 6a5a9014014762847c758e430e1c4e1d74eda897 /src | |
parent | d54b91582b6f8ba1a2c26411dd122d80930f3b02 (diff) | |
download | tmwa-e2f3dc61d7f2720f80d247354604b1ebdc15aad6.tar.gz tmwa-e2f3dc61d7f2720f80d247354604b1ebdc15aad6.tar.bz2 tmwa-e2f3dc61d7f2720f80d247354604b1ebdc15aad6.tar.xz tmwa-e2f3dc61d7f2720f80d247354604b1ebdc15aad6.zip |
Prevent buying more items than you can carry
Diffstat (limited to 'src')
-rw-r--r-- | src/map/npc.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) |