fix(Core/Item): Mirror client logic when determining whether to apply… (#16861)

fix(Core/Item): Mirror client logic when determining whether to apply feral AP

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Kitzunu
2023-07-31 04:59:21 +02:00
committed by GitHub
parent 933a3a7c0d
commit 8c42a03328

View File

@@ -752,8 +752,10 @@ struct ItemTemplate
[[nodiscard]] int32 getFeralBonus(int32 extraDPS = 0) const
{
constexpr uint32 feralApEnabledInventoryTypeMaks = 1 << INVTYPE_WEAPON | 1 << INVTYPE_2HWEAPON | 1 << INVTYPE_WEAPONMAINHAND | 1 << INVTYPE_WEAPONOFFHAND;
// 0x02A5F3 - is mask for Melee weapon from ItemSubClassMask.dbc
if (Class == ITEM_CLASS_WEAPON && (1 << SubClass) & 0x02A5F3)
if (Class == ITEM_CLASS_WEAPON && (1 << InventoryType) & feralApEnabledInventoryTypeMaks)
{
int32 bonus = int32((extraDPS + getDPS()) * 14.0f) - 767;
if (bonus < 0)