From 8b6286230afb9539fa25084d3d829c7aa1a1e45b Mon Sep 17 00:00:00 2001 From: NotAdam Date: Tue, 12 Jun 2018 13:11:47 +0000 Subject: [PATCH] add silent param to not send item obtain actrl --- src/servers/sapphire_zone/Inventory/Inventory.cpp | 7 ++++--- src/servers/sapphire_zone/Inventory/Inventory.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/servers/sapphire_zone/Inventory/Inventory.cpp b/src/servers/sapphire_zone/Inventory/Inventory.cpp index 909065f6..a4d5e015 100644 --- a/src/servers/sapphire_zone/Inventory/Inventory.cpp +++ b/src/servers/sapphire_zone/Inventory/Inventory.cpp @@ -479,7 +479,7 @@ bool Core::Inventory::isObtainable( uint32_t catalogId, uint8_t quantity ) } -int16_t Core::Inventory::addItem( uint16_t inventoryId, int8_t slotId, uint32_t catalogId, uint16_t quantity, bool isHq ) +int16_t Core::Inventory::addItem( uint16_t inventoryId, int8_t slotId, uint32_t catalogId, uint16_t quantity, bool isHq, bool silent ) { auto pDb = g_fw.get< Db::DbWorkerPool< Db::CharaDbConnection > >(); auto pExdData = g_fw.get< Data::ExdDataGenerated >(); @@ -531,7 +531,8 @@ int16_t Core::Inventory::addItem( uint16_t inventoryId, int8_t slotId, uint32_t invUpPacket.data().condition = 30000; m_pOwner->queuePacket( invUpPacket ); - m_pOwner->queuePacket( ActorControlPacket143( m_pOwner->getId(), ItemObtainIcon, catalogId, item->getStackSize() ) ); + if( !silent ) + m_pOwner->queuePacket( ActorControlPacket143( m_pOwner->getId(), ItemObtainIcon, catalogId, item->getStackSize() ) ); } @@ -623,7 +624,7 @@ void Core::Inventory::splitItem( uint16_t fromInventoryId, uint8_t fromSlotId, u // todo: correct invalid move? again, not sure what retail does here return; - auto newSlot = addItem( toInventoryId, toSlot, fromItem->getId(), itemCount, fromItem->isHq() ); + auto newSlot = addItem( toInventoryId, toSlot, fromItem->getId(), itemCount, fromItem->isHq(), true ); if( newSlot == -1 ) return; diff --git a/src/servers/sapphire_zone/Inventory/Inventory.h b/src/servers/sapphire_zone/Inventory/Inventory.h index 57ab2c50..082fbc2d 100644 --- a/src/servers/sapphire_zone/Inventory/Inventory.h +++ b/src/servers/sapphire_zone/Inventory/Inventory.h @@ -140,7 +140,7 @@ public: InvSlotPairVec getSlotsOfItemsInInventory( uint32_t catalogId ); InvSlotPair getFreeBagSlot(); - int16_t addItem( uint16_t inventoryId, int8_t slotId, uint32_t catalogId, uint16_t quantity = 1, bool isHq = false ); + int16_t addItem( uint16_t inventoryId, int8_t slotId, uint32_t catalogId, uint16_t quantity = 1, bool isHq = false, bool silent = false ); void moveItem( uint16_t fromInventoryId, uint8_t fromSlotId, uint16_t toInventoryId, uint8_t toSlot ); void swapItem( uint16_t fromInventoryId, uint8_t fromSlotId, uint16_t toInventoryId, uint8_t toSlot ); void discardItem( uint16_t fromInventoryId, uint8_t fromSlotId );