feat(Core/Scripting): Implement OnIsAffectedBySpellModCheck hook (#9903)

This commit is contained in:
Skjalf
2021-12-30 17:39:13 -03:00
committed by GitHub
parent 53a6fb7513
commit 24ab99919a
3 changed files with 33 additions and 1 deletions

View File

@@ -1280,8 +1280,19 @@ bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const
return false;
SpellInfo const* affectSpell = sSpellMgr->GetSpellInfo(mod->spellId);
if (!affectSpell)
{
return false;
}
if (!sScriptMgr->OnIsAffectedBySpellModCheck(affectSpell, this, mod))
{
return true;
}
// False if affect_spell == nullptr or spellFamily not equal
if (!affectSpell || affectSpell->SpellFamilyName != SpellFamilyName)
if (affectSpell->SpellFamilyName != SpellFamilyName)
return false;
// true