mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 08:07:46 +00:00
improve behaviour for creating items with correct max stack sizes
This commit is contained in:
parent
f702d37bc9
commit
b199036f5a
1 changed files with 1 additions and 4 deletions
|
@ -566,10 +566,7 @@ Core::ItemPtr Core::Entity::Player::createItem( uint32_t catalogId, uint16_t qua
|
||||||
if( !itemInfo )
|
if( !itemInfo )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
uint16_t itemAmount = quantity;
|
auto itemAmount = std::min< uint16_t >( quantity, static_cast< uint16_t >( itemInfo->stackSize ) );
|
||||||
|
|
||||||
if( itemInfo->stackSize == 1 )
|
|
||||||
itemAmount = 1;
|
|
||||||
|
|
||||||
if( !itemInfo )
|
if( !itemInfo )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Add table
Reference in a new issue