Core/Items: Implemented reagent bag

Port From (https://github.com/TrinityCore/TrinityCore/commit/6f9e359701bd75705f73f23af65affb5a5bed573)
This commit is contained in:
Hondacrx
2024-08-24 22:26:12 -04:00
parent ab0333aa71
commit 728d5f58bc
5 changed files with 189 additions and 289 deletions
+1 -19
View File
@@ -99,25 +99,7 @@ namespace Game
return;
}
uint freeBagSlots = 0;
if (!voidStorageTransfer.Withdrawals.Empty())
{
// make this a Player function
for (byte i = InventorySlots.BagStart; i < InventorySlots.BagEnd; i++)
{
Bag bag = player.GetBagByPos(i);
if (bag != null)
freeBagSlots += bag.GetFreeSlots();
}
int inventoryEnd = InventorySlots.ItemStart + _player.GetInventorySlotCount();
for (byte i = InventorySlots.ItemStart; i < inventoryEnd; i++)
{
if (player.GetItemByPos(InventorySlots.Bag0, i) == null)
++freeBagSlots;
}
}
if (voidStorageTransfer.Withdrawals.Length > freeBagSlots)
if (!voidStorageTransfer.Withdrawals.Empty() && voidStorageTransfer.Withdrawals.Length > _player.GetFreeInventorySlotCount(ItemSearchLocation.Inventory))
{
SendVoidStorageTransferResult(VoidTransferError.InventoryFull);
return;