1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 06:47:45 +00:00

fix items being dropped from globalitem when moving to house inv

This commit is contained in:
NotAdam 2018-12-29 21:51:43 +11:00
parent b5b49f4d8c
commit d6d8edf57c
3 changed files with 4 additions and 4 deletions

View file

@ -876,7 +876,7 @@ Sapphire::ItemPtr Sapphire::Entity::Player::dropInventoryItem( Sapphire::Common:
return nullptr;
// unlink item
container->removeItem( slotId );
container->removeItem( slotId, false );
updateContainer( type, slotId, nullptr );
auto seq = getNextInventorySequence();

View file

@ -36,14 +36,14 @@ uint16_t Sapphire::ItemContainer::getEntryCount() const
return static_cast< uint16_t >( m_itemMap.size() );
}
void Sapphire::ItemContainer::removeItem( uint16_t slotId )
void Sapphire::ItemContainer::removeItem( uint16_t slotId, bool removeFromDb )
{
auto pDb = m_pFw->get< Db::DbWorkerPool< Db::ZoneDbConnection > >();
ItemMap::iterator it = m_itemMap.find( slotId );
if( it != m_itemMap.end() )
{
if( m_isPersistentStorage )
if( m_isPersistentStorage && removeFromDb )
pDb->execute( "DELETE FROM charaglobalitem WHERE itemId = " + std::to_string( it->second->getUId() ) );
m_itemMap.erase( it );

View file

@ -23,7 +23,7 @@ namespace Sapphire
uint16_t getEntryCount() const;
void removeItem( uint16_t slotId );
void removeItem( uint16_t slotId, bool removeFromDb = true );
ItemMap& getItemMap();