Core/Player: partial revert of m_items handling as it's cause of a exploit
Port From (https://github.com/TrinityCore/TrinityCore/commit/3d1da4957cd7ee3320eed089ad213af09050ade1)
This commit is contained in:
@@ -295,7 +295,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
ItemTemplate proto = item.GetTemplate();
|
ItemTemplate proto = item.GetTemplate();
|
||||||
WeaponAttackType attType = GetAttackBySlot(slot, proto.GetInventoryType());
|
WeaponAttackType attType = GetAttackBySlot(slot, proto.GetInventoryType());
|
||||||
if (attType == WeaponAttackType.Max)
|
if (!IsInFeralForm() && apply && !CanUseAttackType(attType))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float damage = 0.0f;
|
float damage = 0.0f;
|
||||||
|
|||||||
@@ -1873,8 +1873,6 @@ namespace Game.Entities
|
|||||||
if (pProto != null && pProto.GetItemSet() != 0)
|
if (pProto != null && pProto.GetItemSet() != 0)
|
||||||
Item.RemoveItemsSetItem(this, pProto);
|
Item.RemoveItemsSetItem(this, pProto);
|
||||||
|
|
||||||
// remove here before _ApplyItemMods (for example to register correct damages of unequipped weapon)
|
|
||||||
m_items[slot] = null;
|
|
||||||
_ApplyItemMods(pItem, slot, false, update);
|
_ApplyItemMods(pItem, slot, false, update);
|
||||||
|
|
||||||
pItem.RemoveItemFlag2(ItemFieldFlags2.Equipped);
|
pItem.RemoveItemFlag2(ItemFieldFlags2.Equipped);
|
||||||
@@ -1897,9 +1895,8 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
m_items[slot] = null;
|
|
||||||
|
|
||||||
|
m_items[slot] = null;
|
||||||
SetInvSlot(slot, ObjectGuid.Empty);
|
SetInvSlot(slot, ObjectGuid.Empty);
|
||||||
|
|
||||||
if (slot < EquipmentSlot.End)
|
if (slot < EquipmentSlot.End)
|
||||||
@@ -3811,7 +3808,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
WeaponAttackType attType = GetAttackBySlot(slot, proto.GetInventoryType());
|
WeaponAttackType attType = GetAttackBySlot(slot, proto.GetInventoryType());
|
||||||
if (attType != WeaponAttackType.Max && CanUseAttackType(attType))
|
if (attType != WeaponAttackType.Max)
|
||||||
_ApplyWeaponDamage(slot, item, apply);
|
_ApplyWeaponDamage(slot, item, apply);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5440,9 +5437,6 @@ namespace Game.Entities
|
|||||||
if (pProto != null && pProto.GetItemSet() != 0)
|
if (pProto != null && pProto.GetItemSet() != 0)
|
||||||
Item.RemoveItemsSetItem(this, pProto);
|
Item.RemoveItemsSetItem(this, pProto);
|
||||||
|
|
||||||
// clear m_items so weapons for example can be registered as unequipped
|
|
||||||
m_items[slot] = null;
|
|
||||||
|
|
||||||
_ApplyItemMods(pItem, slot, false);
|
_ApplyItemMods(pItem, slot, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5468,9 +5462,7 @@ namespace Game.Entities
|
|||||||
SetVisibleItemSlot(slot, null);
|
SetVisibleItemSlot(slot, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear for rest of items (ie nonequippable)
|
m_items[slot] = null;
|
||||||
if (slot >= InventorySlots.BagEnd)
|
|
||||||
m_items[slot] = null;
|
|
||||||
}
|
}
|
||||||
else if ((pBag = GetBagByPos(bag)) != null)
|
else if ((pBag = GetBagByPos(bag)) != null)
|
||||||
pBag.RemoveItem(slot, update);
|
pBag.RemoveItem(slot, update);
|
||||||
|
|||||||
Reference in New Issue
Block a user