Core/Spells: Fix immunity checks on apply aura - original patch by devilcoredev, changed a bit so immunity checks are grouped together instead of being spread.

This commit is contained in:
QAston
2012-02-04 15:27:47 +01:00
parent 6b12f39b35
commit 9d185c5d66
2 changed files with 15 additions and 5 deletions
+7 -1
View File
@@ -520,7 +520,13 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
bool addUnit = true;
// check target immunities
if (itr->first->IsImmunedToSpell(GetSpellInfo())
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
{
if (!itr->first->IsImmunedToSpellEffect(GetSpellInfo(), effIndex))
itr->second &= ~(1 << effIndex);
}
if (!itr->second
|| itr->first->IsImmunedToSpell(GetSpellInfo())
|| !CanBeAppliedOn(itr->first))
addUnit = false;