Core/Player: Distinguish between ranged and non-ranged weapons in GetWeaponForAttack

Port From (https://github.com/TrinityCore/TrinityCore/commit/5517208b67cf5c0b8054067cee081e968e66694d)
This commit is contained in:
hondacrx
2022-06-16 22:28:50 -04:00
parent 9da9a7eb0e
commit 71b7018590
+4
View File
@@ -7559,9 +7559,13 @@ namespace Game.Entities
item = GetUseableItemByPos(InventorySlots.Bag0, slot);
else
item = GetItemByPos(InventorySlots.Bag0, slot);
if (item == null || item.GetTemplate().GetClass() != ItemClass.Weapon)
return null;
if ((attackType == WeaponAttackType.RangedAttack) != item.GetTemplate().IsRangedWeapon())
return null;
if (!useable)
return item;