From ae5bf57dbaa3db4367689aedc84dd3336edcf27b Mon Sep 17 00:00:00 2001 From: Christopher Galbraith <39371221+ChrisCGalbraith@users.noreply.github.com> Date: Sun, 12 Nov 2023 16:51:26 +0000 Subject: [PATCH] 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 --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 9fdbae85b..1a2087ca5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -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; }