summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorIbrahim Hossam <ibrahem.h.basyone@gmail.com>2015-07-06 21:38:11 +0200
committerIbrahim Hossam <ibrahem.h.basyone@gmail.com>2015-07-08 03:26:34 +0200
commit856b6f1feb25ca74d716a4c22fff650e0ff065a0 (patch)
treec3035ea753ff2c79c1e969056a120998e4f2dd2c /src/map/pc.c
parent0177783215ae97d08109f7af91a20b78b6a0df90 (diff)
downloadhercules-856b6f1feb25ca74d716a4c22fff650e0ff065a0.tar.gz
hercules-856b6f1feb25ca74d716a4c22fff650e0ff065a0.tar.bz2
hercules-856b6f1feb25ca74d716a4c22fff650e0ff065a0.tar.xz
hercules-856b6f1feb25ca74d716a4c22fff650e0ff065a0.zip
Update Unique ID system to match official now it cover all cash items include stackable ones.
Implement ForceSerial option in Package Item Database to force serial for any item. Implement ForceSerial option in item database to force serial for any item. Implement Merge Client interface to merge stackable items with serial numbers ( check npc/other/item_merge.txt ).
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 9e9f993d0..4dac559e2 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4448,6 +4448,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
if( sd->status.inventory[i].nameid == item_data->nameid &&
sd->status.inventory[i].bound == item_data->bound &&
sd->status.inventory[i].expire_time == 0 &&
+ sd->status.inventory[i].unique_id == item_data->unique_id &&
memcmp(&sd->status.inventory[i].card, &item_data->card, sizeof(item_data->card)) == 0 ) {
if( amount > MAX_AMOUNT - sd->status.inventory[i].amount || ( data->stack.inventory && amount > data->stack.amount - sd->status.inventory[i].amount ) )
return 5;
@@ -4475,8 +4476,8 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
clif->additem(sd,i,amount,0);
}
- if( !itemdb->isstackable2(data) && !item_data->unique_id )
- sd->status.inventory[i].unique_id = itemdb->unique_id(sd);
+ if( ( !itemdb->isstackable2(data) || data->flag.force_serial || data->type == IT_CASH) && !item_data->unique_id )
+ sd->status.inventory[i].unique_id = itemdb->unique_id(sd);
logs->pick_pc(sd, log_type, amount, &sd->status.inventory[i],sd->inventory_data[i]);
@@ -5028,7 +5029,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
sd->status.cart[i].card[2] == item_data->card[2] && sd->status.cart[i].card[3] == item_data->card[3] );
};
- if( i < MAX_CART )
+ if( i < MAX_CART && item_data->unique_id == sd->status.cart[i].unique_id)
{// item already in cart, stack it
if( amount > MAX_AMOUNT - sd->status.cart[i].amount || ( data->stack.cart && amount > data->stack.amount - sd->status.cart[i].amount ) )
return 2; // no room