Core/Items: Implemented reagent bag
Port From (https://github.com/TrinityCore/TrinityCore/commit/6f9e359701bd75705f73f23af65affb5a5bed573)
This commit is contained in:
@@ -287,7 +287,7 @@ namespace Game
|
||||
|
||||
// if inventory item was moved, check if we can remove dependent auras, because they were not removed in Player::RemoveItem (update was set to false)
|
||||
// do this after swaps are done, we pass nullptr because both weapons could be swapped and none of them should be ignored
|
||||
if ((autoEquipItem.PackSlot == InventorySlots.Bag0 && autoEquipItem.Slot < InventorySlots.BagEnd) || (dstbag == InventorySlots.Bag0 && dstslot < InventorySlots.BagEnd))
|
||||
if ((autoEquipItem.PackSlot == InventorySlots.Bag0 && autoEquipItem.Slot < InventorySlots.ReagentBagEnd) || (dstbag == InventorySlots.Bag0 && dstslot < InventorySlots.ReagentBagEnd))
|
||||
pl.ApplyItemDependentAuras(null, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user