mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 16:17:46 +00:00
fix issue where items couldn't be removed from interior storeroom
This commit is contained in:
parent
803fcfe4de
commit
b7fcf6080c
1 changed files with 16 additions and 13 deletions
|
@ -1386,24 +1386,24 @@ bool Sapphire::World::Manager::HousingMgr::removeInternalItem( Entity::Player& p
|
||||||
{
|
{
|
||||||
auto& containers = getEstateInventory( terri.getLandIdent() );
|
auto& containers = getEstateInventory( terri.getLandIdent() );
|
||||||
|
|
||||||
// validate the container id first
|
|
||||||
// we also need the idx of the container so we can get the slot offset
|
|
||||||
bool foundContainer = false;
|
|
||||||
uint8_t containerIdx = 0;
|
uint8_t containerIdx = 0;
|
||||||
|
|
||||||
|
if( isPlacedItemsInventory( static_cast< Common::InventoryType >( containerId ) ) )
|
||||||
|
{
|
||||||
for( auto cId : m_internalPlacedItemContainers )
|
for( auto cId : m_internalPlacedItemContainers )
|
||||||
{
|
{
|
||||||
if( containerId == cId )
|
if( containerId == cId )
|
||||||
{
|
|
||||||
foundContainer = true;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
containerIdx++;
|
containerIdx++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
containerIdx = -1;
|
||||||
|
|
||||||
if( !foundContainer )
|
// its possible to remove an item from any container in basically all these remove functions
|
||||||
return false;
|
// eg, remove a permit and reuse it elsewhere
|
||||||
|
// I'm not going to bother fixing it for now, but worth noting for future reference
|
||||||
|
|
||||||
auto needle = containers.find( containerId );
|
auto needle = containers.find( containerId );
|
||||||
if( needle == containers.end() )
|
if( needle == containers.end() )
|
||||||
|
@ -1457,8 +1457,11 @@ bool Sapphire::World::Manager::HousingMgr::removeInternalItem( Entity::Player& p
|
||||||
}
|
}
|
||||||
|
|
||||||
// despawn
|
// despawn
|
||||||
|
if( containerIdx != -1 )
|
||||||
|
{
|
||||||
auto arraySlot = ( containerIdx * 50 ) + slotId;
|
auto arraySlot = ( containerIdx * 50 ) + slotId;
|
||||||
terri.removeHousingObject( arraySlot );
|
terri.removeHousingObject( arraySlot );
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue