summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-08 19:37:16 -0200
committershennetsind <ind@henn.et>2014-02-08 19:37:16 -0200
commitafcb4bcae5d28a4156cce4d0f833e95432d45797 (patch)
treedcb95c9168b00d8342917fd083a8c52d22a7d44b
parent891bd0576d342a1b560672e905f42daa5da12d5d (diff)
downloadhercules-afcb4bcae5d28a4156cce4d0f833e95432d45797.tar.gz
hercules-afcb4bcae5d28a4156cce4d0f833e95432d45797.tar.bz2
hercules-afcb4bcae5d28a4156cce4d0f833e95432d45797.tar.xz
hercules-afcb4bcae5d28a4156cce4d0f833e95432d45797.zip
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 <ind@henn.et>
-rw-r--r--src/map/pc.c13
1 files changed, 7 insertions, 6 deletions
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;