Core/Player: properly clear m_items array when unequipping items from the bag

Port From (https://github.com/TrinityCore/TrinityCore/commit/4a386b97d2094a6d67039c7068edbf26000bbf5e)
This commit is contained in:
hondacrx
2021-09-09 13:51:36 -04:00
parent 30bd4aa6b1
commit a0952d0776
+9 -1
View File
@@ -1897,6 +1897,8 @@ namespace Game.Entities
}
}
}
else
m_items[slot] = null;
SetInvSlot(slot, ObjectGuid.Empty);
@@ -5438,6 +5440,9 @@ namespace Game.Entities
if (pProto != null && pProto.GetItemSet() != 0)
Item.RemoveItemsSetItem(this, pProto);
// clear m_items so weapons for example can be registered as unequipped
m_items[slot] = null;
_ApplyItemMods(pItem, slot, false);
}
@@ -5462,7 +5467,10 @@ namespace Game.Entities
// equipment visual show
SetVisibleItemSlot(slot, null);
}
m_items[slot] = null;
// clear for rest of items (ie nonequippable)
if (slot >= InventorySlots.BagEnd)
m_items[slot] = null;
}
else if ((pBag = GetBagByPos(bag)) != null)
pBag.RemoveItem(slot, update);