mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
fix items being dropped from globalitem when moving to house inv
This commit is contained in:
parent
b5b49f4d8c
commit
d6d8edf57c
3 changed files with 4 additions and 4 deletions
|
@ -876,7 +876,7 @@ Sapphire::ItemPtr Sapphire::Entity::Player::dropInventoryItem( Sapphire::Common:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
// unlink item
|
// unlink item
|
||||||
container->removeItem( slotId );
|
container->removeItem( slotId, false );
|
||||||
updateContainer( type, slotId, nullptr );
|
updateContainer( type, slotId, nullptr );
|
||||||
|
|
||||||
auto seq = getNextInventorySequence();
|
auto seq = getNextInventorySequence();
|
||||||
|
|
|
@ -36,14 +36,14 @@ uint16_t Sapphire::ItemContainer::getEntryCount() const
|
||||||
return static_cast< uint16_t >( m_itemMap.size() );
|
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 > >();
|
auto pDb = m_pFw->get< Db::DbWorkerPool< Db::ZoneDbConnection > >();
|
||||||
ItemMap::iterator it = m_itemMap.find( slotId );
|
ItemMap::iterator it = m_itemMap.find( slotId );
|
||||||
|
|
||||||
if( it != m_itemMap.end() )
|
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() ) );
|
pDb->execute( "DELETE FROM charaglobalitem WHERE itemId = " + std::to_string( it->second->getUId() ) );
|
||||||
|
|
||||||
m_itemMap.erase( it );
|
m_itemMap.erase( it );
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Sapphire
|
||||||
|
|
||||||
uint16_t getEntryCount() const;
|
uint16_t getEntryCount() const;
|
||||||
|
|
||||||
void removeItem( uint16_t slotId );
|
void removeItem( uint16_t slotId, bool removeFromDb = true );
|
||||||
|
|
||||||
ItemMap& getItemMap();
|
ItemMap& getItemMap();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue