From 3d9a90cbb7b6c6fdc42d7aca509c53dd0f7eefd7 Mon Sep 17 00:00:00 2001 From: NotAdam Date: Fri, 28 Dec 2018 10:17:05 +1100 Subject: [PATCH] fix removed housing items being orphaned after relogging --- src/world/Actor/PlayerInventory.cpp | 4 ++-- src/world/Manager/HousingMgr.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/world/Actor/PlayerInventory.cpp b/src/world/Actor/PlayerInventory.cpp index 850c45e2..95bd52fb 100644 --- a/src/world/Actor/PlayerInventory.cpp +++ b/src/world/Actor/PlayerInventory.cpp @@ -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 ); + } \ No newline at end of file diff --git a/src/world/Manager/HousingMgr.cpp b/src/world/Manager/HousingMgr.cpp index 7d47d347..7e576b4e 100644 --- a/src/world/Manager/HousingMgr.cpp +++ b/src/world/Manager/HousingMgr.cpp @@ -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;