Index: src/server/gem.cpp =================================================================== --- src/server/gem.cpp (revision 5444) +++ src/server/gem.cpp (working copy) @@ -1510,7 +1510,7 @@ * and fake the stack count before calling AddToContainer with the test flag; * we put it back when we're done. */ - uint currentSize = 0; + float currentSize = 0; gemContainer::psContainerIterator iter(this); while (iter.HasNext()) { Index: src/server/bulkobjects/pscharinventory.cpp =================================================================== --- src/server/bulkobjects/pscharinventory.cpp (revision 5444) +++ src/server/bulkobjects/pscharinventory.cpp (working copy) @@ -423,8 +423,9 @@ } // If moving inside the same container, allow it - if (item->GetContainerID() == parentItem->GetUID()) - return true; + // if (item->GetContainerID() == parentItem->GetUID()) + // return true; + // allowing this without any checking is not safe if the size of it's content or the container changed // check if the item fit in the container if(doRestrictions && @@ -596,7 +597,7 @@ if (tocheck->GetContainerID()) { - size_t size = FindItemID(tocheck->GetContainerID())->GetContainerMaxSize() - GetContainedSize(FindItemID(tocheck->GetContainerID())); + float size = FindItemID(tocheck->GetContainerID())->GetContainerMaxSize() - GetContainedSize(FindItemID(tocheck->GetContainerID())); if(size/item->GetItemSize() < fits) fits = size/item->GetItemSize(); } @@ -665,7 +666,7 @@ itemIndices = FindCompatibleStackedItems(item); for (i=0; iGetContainerID()){ size = GetContainedSize(FindItemID(inventory[itemIndices[i]].item->GetContainerID())); } @@ -744,7 +745,7 @@ { if (inventory[i].item->GetIsContainer()) { - int size = GetContainedSize(inventory[i].item); + float size = GetContainedSize(inventory[i].item); if (size + item->GetTotalStackSize() <= inventory[i].item->GetContainerMaxSize()) // adequate space in container { INVENTORY_SLOT_NUMBER containerSlot = (INVENTORY_SLOT_NUMBER)FindFirstOpenSlot(inventory[i].item);