1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-24 13:47:46 +00:00

correctly preserve hq/lq stacks & cap quantity correctly

This commit is contained in:
NotAdam 2018-08-25 19:27:38 +10:00
parent 84c5191377
commit ae282c7030

View file

@ -496,8 +496,7 @@ Core::ItemPtr Core::Entity::Player::addItem( uint32_t catalogId, uint32_t quanti
return nullptr; return nullptr;
} }
if( itemInfo->isEquippable ) quantity = std::min< uint32_t >( quantity, itemInfo->stackSize );
quantity = 1;
// used for item obtain notification // used for item obtain notification
uint32_t originalQuantity = quantity; uint32_t originalQuantity = quantity;
@ -525,6 +524,10 @@ Core::ItemPtr Core::Entity::Player::addItem( uint32_t catalogId, uint32_t quanti
if( count >= maxStack ) if( count >= maxStack )
continue; continue;
// check slot is same quality
if( item->isHq() != isHq )
continue;
// update stack // update stack
uint32_t newStackSize = count + quantity; uint32_t newStackSize = count + quantity;
uint32_t overflow = 0; uint32_t overflow = 0;