From ac5958c8ee91101d914af9104738d3072e82f9ae Mon Sep 17 00:00:00 2001 From: Erick Sanhueza Date: Sun, 21 Mar 2021 11:19:52 -0300 Subject: [PATCH] fix(Core/AI): add condition to force casters into melee combat (#4894) --- src/server/game/AI/SmartScripts/SmartScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 8294b92c9..3a3d58b7b 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -772,7 +772,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.action.cast.spell); int32 currentPower = me->GetPower(GetCasterPowerType()); - if ((spellInfo && (currentPower < spellInfo->CalcPowerCost(me, spellInfo->GetSchoolMask()))) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) + if ((spellInfo && (currentPower < spellInfo->CalcPowerCost(me, spellInfo->GetSchoolMask()) || me->IsSpellProhibited(spellInfo->GetSchoolMask()))) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) { SetCasterActualDist(0); CAST_AI(SmartAI, me->AI())->SetForcedCombatMove(0);