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:
parent
84c5191377
commit
ae282c7030
1 changed files with 5 additions and 2 deletions
|
@ -496,8 +496,7 @@ Core::ItemPtr Core::Entity::Player::addItem( uint32_t catalogId, uint32_t quanti
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if( itemInfo->isEquippable )
|
||||
quantity = 1;
|
||||
quantity = std::min< uint32_t >( quantity, itemInfo->stackSize );
|
||||
|
||||
// used for item obtain notification
|
||||
uint32_t originalQuantity = quantity;
|
||||
|
@ -525,6 +524,10 @@ Core::ItemPtr Core::Entity::Player::addItem( uint32_t catalogId, uint32_t quanti
|
|||
if( count >= maxStack )
|
||||
continue;
|
||||
|
||||
// check slot is same quality
|
||||
if( item->isHq() != isHq )
|
||||
continue;
|
||||
|
||||
// update stack
|
||||
uint32_t newStackSize = count + quantity;
|
||||
uint32_t overflow = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue