aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 123dbbcf2eb..86d1d23be75 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -13003,17 +13003,23 @@ void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
void Unit::AddAura(uint32 spellId, Unit* target)
{
- if(!target)
+ if(!target || !target->isAlive())
return;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
if(!spellInfo)
return;
+ if (target->IsImmunedToSpell(spellInfo))
+ return;
+
for(uint32 i = 0; i < 3; ++i)
{
if(spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA)
{
+ if(target->IsImmunedToSpellEffect(spellInfo->Effect[i], spellInfo->EffectMechanic[i]))
+ continue;
+
if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_CASTER)
{
Aura *Aur = CreateAura(spellInfo, i, NULL, this, this);