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

fix removed housing items being orphaned after relogging

This commit is contained in:
NotAdam 2018-12-28 10:17:05 +11:00
parent 298b31512c
commit 3d9a90cbb7
2 changed files with 4 additions and 4 deletions

View file

@ -930,9 +930,9 @@ bool Sapphire::Entity::Player::getFreeInventoryContainerSlot( Entity::Player::In
void Sapphire::Entity::Player::insertInventoryItem( Sapphire::Common::InventoryType type, uint16_t slot,
const Sapphire::ItemPtr item )
{
auto& container = m_storageMap[ type ];
container->setItem( slot, item );
updateContainer( type, slot, item );
auto slotUpdate = std::make_shared< UpdateInventorySlotPacket >( getId(), slot, type, *item );
queuePacket( slotUpdate );
}

View file

@ -241,7 +241,7 @@ void Sapphire::World::Manager::HousingMgr::initLandCache()
auto makeContainer = [ &containers ]( Common::InventoryType type, uint16_t size )
{
containers[ type ] = make_ItemContainer( type, size, "houseiteminventory", false );
containers[ type ] = make_ItemContainer( type, size, "houseiteminventory", false, false );
};
uint16_t count = 0;
@ -1358,7 +1358,7 @@ bool Sapphire::World::Manager::HousingMgr::removeInternalItem( Entity::Player& p
player.insertInventoryItem( containerPair.first, containerPair.second, item );
// todo: set item as bound/unsellable/untradable
// despawn
auto arraySlot = ( containerIdx * 50 ) + slotId;