fix(Core/AI): add condition to force casters into melee combat (#4894)

This commit is contained in:
Erick Sanhueza
2021-03-21 11:19:52 -03:00
committed by GitHub
parent e06d30e686
commit ac5958c8ee

View File

@@ -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);