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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user