Core/Items: HasItemCount and DestroyItemCount now count bank bags

This commit is contained in:
hondacrx
2018-04-28 11:48:44 -04:00
parent aac1d9c6fb
commit 3d6c47336c
+32 -1
View File
@@ -3017,7 +3017,7 @@ namespace Game.Entities
if (inBankAlso)
{
for (byte i = InventorySlots.BankItemStart; i < InventorySlots.BankItemEnd; i++)
for (byte i = InventorySlots.BankItemStart; i < InventorySlots.BankBagEnd; i++)
{
Item pItem = GetItemByPos(InventorySlots.Bag0, i);
if (pItem != null && pItem.GetEntry() == item && !pItem.IsInTrade())
@@ -5895,6 +5895,37 @@ namespace Game.Entities
}
}
// in bank bag list
for (byte i = InventorySlots.BankBagStart; i < InventorySlots.BankBagEnd; i++)
{
Item item = GetItemByPos(InventorySlots.Bag0, i);
if (item)
{
if (item.GetEntry() == itemEntry && !item.IsInTrade())
{
if (item.GetCount() + remcount <= count)
{
if (!unequip_check || CanUnequipItem((ushort)(InventorySlots.Bag0 << 8 | i), false) == InventoryResult.Ok)
{
remcount += item.GetCount();
DestroyItem(InventorySlots.Bag0, i, update);
if (remcount >= count)
return;
}
}
else
{
ItemRemovedQuestCheck(item.GetEntry(), count - remcount);
item.SetCount(item.GetCount() - count + remcount);
if (IsInWorld && update)
item.SendUpdateToPlayer(this);
item.SetState(ItemUpdateState.Changed, this);
return;
}
}
}
}
for (byte i = InventorySlots.ReagentStart; i < InventorySlots.ReagentEnd; ++i)
{
Item item = GetItemByPos(InventorySlots.Bag0, i);