From afcb4bcae5d28a4156cce4d0f833e95432d45797 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 8 Feb 2014 19:37:16 -0200 Subject: Fixed Bug 7978 Consumables with expire item no longer stack with those without expire time Thanks to kyeme. http://hercules.ws/board/tracker/issue-7978-rental-item-stackable/ Signed-off-by: shennetsind --- src/map/pc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/map') diff --git a/src/map/pc.c b/src/map/pc.c index 38466dc01..14e7d4661 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3957,12 +3957,13 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l i = MAX_INVENTORY; - if( itemdb->isstackable2(data) && item_data->expire_time == 0 ) - { // Stackable | Non Rental - for( i = 0; i < MAX_INVENTORY; i++ ) - { - if( sd->status.inventory[i].nameid == item_data->nameid && sd->status.inventory[i].bound == item_data->bound && memcmp(&sd->status.inventory[i].card, &item_data->card, sizeof(item_data->card)) == 0 ) - { + // Stackable | Non Rental + if( itemdb->isstackable2(data) && item_data->expire_time == 0 ) { + for( i = 0; i < MAX_INVENTORY; i++ ) { + if( sd->status.inventory[i].nameid == item_data->nameid && + sd->status.inventory[i].bound == item_data->bound && + sd->status.inventory[i].expire_time == 0 && + 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; sd->status.inventory[i].amount += amount; -- cgit v1.2.3-60-g2f50