fix(Core/Spell): Titan's Grip check if player has 2H and shield equipped (#16984)

* check if player has a 2H and shield equipped

* null check item2 for shield

* style whitespace

* removed unnecessary logic

* remove unnecessary brackets

---------

Co-authored-by: ChrisCGalbraith <chriscgalbraith@gmai.com>
This commit is contained in:
Christopher Galbraith
2023-11-12 16:51:26 +00:00
committed by GitHub
parent 11cc4c4326
commit ae5bf57dba

View File

@@ -528,8 +528,14 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
Item* item1 = caster->ToPlayer()->GetWeaponForAttack(BASE_ATTACK);
Item* item2 = caster->ToPlayer()->GetWeaponForAttack(OFF_ATTACK);
if (item1 && item2 && (item1->GetTemplate()->InventoryType == INVTYPE_2HWEAPON || item2->GetTemplate()->InventoryType == INVTYPE_2HWEAPON))
if (!item2)
item2 = caster->ToPlayer()->GetShield();
if (item1 && item2
&& (item1->GetTemplate()->InventoryType == INVTYPE_2HWEAPON || item2->GetTemplate()->InventoryType == INVTYPE_2HWEAPON))
{
amount = -10;
}
else
amount = 0;
}