diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-27 11:30:37 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-27 11:30:37 +0000 |
commit | c82d8121d5c52e42242d9f3f8be36f0aed569701 (patch) | |
tree | 9e22f1dec5282717cf32fe6fe7e1697a2289d181 /src/map/storage.c | |
parent | d10cf69aff5fdc4894535e62705de9f6bdfe2672 (diff) | |
download | hercules-c82d8121d5c52e42242d9f3f8be36f0aed569701.tar.gz hercules-c82d8121d5c52e42242d9f3f8be36f0aed569701.tar.bz2 hercules-c82d8121d5c52e42242d9f3f8be36f0aed569701.tar.xz hercules-c82d8121d5c52e42242d9f3f8be36f0aed569701.zip |
* Added item stacking limit database (item_stack.txt) required for runes and other 3rd class related skill items.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14635 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/storage.c')
-rw-r--r-- | src/map/storage.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/map/storage.c b/src/map/storage.c index eb64d3eb4..9aa34d3e0 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -138,6 +138,11 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data, data = itemdb_search(item_data->nameid); + if( data->stack.storage && amount > data->stack.amount ) + {// item stack limitation + return 1; + } + if( !itemdb_canstore(item_data, pc_isGM(sd)) ) { //Check if item is storable. [Skotlex] clif_displaymessage (sd->fd, msg_txt(264)); @@ -150,7 +155,7 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data, { if( compare_item(&stor->items[i], item_data) ) {// existing items found, stack them - if( amount > MAX_AMOUNT - stor->items[i].amount ) + if( amount > MAX_AMOUNT - stor->items[i].amount || ( data->stack.storage && amount > data->stack.amount - stor->items[i].amount ) ) return 1; stor->items[i].amount += amount; clif_storageitemadded(sd,&stor->items[i],i,amount); @@ -398,6 +403,11 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto if(item_data->nameid <= 0 || amount <= 0) return 1; + if( data->stack.guildstorage && amount > data->stack.amount ) + {// item stack limitation + return 1; + } + if( !itemdb_canguildstore(item_data, pc_isGM(sd)) || item_data->expire_time ) { //Check if item is storable. [Skotlex] clif_displaymessage (sd->fd, msg_txt(264)); @@ -407,7 +417,7 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto if(itemdb_isstackable2(data)){ //Stackable for(i=0;i<MAX_GUILD_STORAGE;i++){ if(compare_item(&stor->items[i], item_data)) { - if(stor->items[i].amount+amount > MAX_AMOUNT) + if( amount > MAX_AMOUNT - stor->items[i].amount || ( data->stack.guildstorage && amount > data->stack.amount - stor->items[i].amount ) ) return 1; stor->items[i].amount+=amount; clif_storageitemadded(sd,&stor->items[i],i,amount); |