1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

Merge pull request #156 from ShelbyZ/upgrade_item_quantity_bitness

Quantity treated as uint32_t at packet level
This commit is contained in:
Mordred 2017-10-23 08:08:07 +02:00 committed by GitHub
commit ff832b298a
2 changed files with 5 additions and 5 deletions

View file

@ -197,9 +197,9 @@ public:
// Inventory / Item / Currency // Inventory / Item / Currency
////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////
/*! add an item to the first free slot in one of the 4 main containers */ /*! add an item to the first free slot in one of the 4 main containers */
bool tryAddItem( uint16_t catalogId, uint16_t quantity ); bool tryAddItem( uint16_t catalogId, uint32_t quantity );
/*! add an item to a given container */ /*! add an item to a given container */
bool addItem( uint16_t containerId, uint16_t catalogId, uint16_t quantity ); bool addItem( uint16_t containerId, uint16_t catalogId, uint32_t quantity );
/*! equip an item to a specified slot */ /*! equip an item to a specified slot */
void equipItem( Inventory::EquipSlot equipSlotId, ItemPtr pItem, bool sendModel ); void equipItem( Inventory::EquipSlot equipSlotId, ItemPtr pItem, bool sendModel );
/*! remove an item from an equipment slot */ /*! remove an item from an equipment slot */

View file

@ -189,10 +189,10 @@ void Core::Entity::Player::removeCrystal( uint8_t type, uint32_t amount )
queuePacket( invUpPacket ); queuePacket( invUpPacket );
} }
bool Core::Entity::Player::tryAddItem( uint16_t catalogId, uint16_t quantity ) bool Core::Entity::Player::tryAddItem( uint16_t catalogId, uint32_t quantity )
{ {
for( uint8_t i = 0; i < 4; i++ ) for( uint16_t i = 0; i < 4; i++ )
{ {
if( m_pInventory->addItem( i, -1, catalogId, quantity ) != -1 ) if( m_pInventory->addItem( i, -1, catalogId, quantity ) != -1 )
{ {
@ -202,7 +202,7 @@ bool Core::Entity::Player::tryAddItem( uint16_t catalogId, uint16_t quantity )
return false; return false;
} }
bool Core::Entity::Player::addItem( uint16_t containerId, uint16_t catalogId, uint16_t quantity ) bool Core::Entity::Player::addItem( uint16_t containerId, uint16_t catalogId, uint32_t quantity )
{ {
if( m_pInventory->addItem( containerId, -1, catalogId, quantity ) != -1 ) if( m_pInventory->addItem( containerId, -1, catalogId, quantity ) != -1 )
return true; return true;