Core/Player: only call _ApplyWeaponDamage for actual weapons

Port From (https://github.com/TrinityCore/TrinityCore/commit/905112b2a61c5b3999f936d957e10a3ee6258751)
This commit is contained in:
hondacrx
2021-06-23 14:42:03 -04:00
parent a34469c171
commit e8b7f00161
2 changed files with 8 additions and 11 deletions
+5 -8
View File
@@ -291,17 +291,14 @@ namespace Game.Entities
return true;
}
public void _ApplyWeaponDamage(uint slot, Item item, bool apply)
public void _ApplyWeaponDamage(byte slot, Item item, bool apply)
{
ItemTemplate proto = item.GetTemplate();
WeaponAttackType attType = WeaponAttackType.BaseAttack;
WeaponAttackType attType = GetAttackBySlot(slot, proto.GetInventoryType());
if (attType == WeaponAttackType.Max)
return;
float damage = 0.0f;
if (slot == EquipmentSlot.MainHand && (proto.GetInventoryType() == InventoryType.Ranged || proto.GetInventoryType() == InventoryType.RangedRight))
attType = WeaponAttackType.RangedAttack;
else if (slot == EquipmentSlot.OffHand)
attType = WeaponAttackType.OffAttack;
uint itemLevel = item.GetItemLevel(this);
float minDamage, maxDamage;
proto.GetDamage(itemLevel, out minDamage, out maxDamage);