diff options
author | megamage <none@none> | 2009-08-27 16:41:10 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-27 16:41:10 -0500 |
commit | ee3c766bc95f05018e7de30d9a0768fd1246be87 (patch) | |
tree | 8f44200c1871fb0c9ab5b0a87e89295b33bee3e5 /src/game/GridNotifiersImpl.h | |
parent | d8290149206a5f8a0a7d5d742fa6f2da280ff695 (diff) |
*Use one dynobj to handle multiple aura effects.
--HG--
branch : trunk
Diffstat (limited to 'src/game/GridNotifiersImpl.h')
-rw-r--r-- | src/game/GridNotifiersImpl.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 7deeb2ec5fd..23b781cab4c 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -178,8 +178,16 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target) if (i_dynobject.IsAffecting(target)) return; - uint32 eff_index = i_dynobject.GetEffIndex(); - if(target->HasAuraEffect(i_dynobject.GetSpellId(), eff_index, i_check->GetGUID())) + if(target->HasAura(i_dynobject.GetSpellId(), i_check->GetGUID())) + return; + + + uint32 eff_index = 0; + for(; eff_index < MAX_SPELL_EFFECTS; ++eff_index) + if(i_dynobject.HasEffect(eff_index)) + break; + + if(eff_index == MAX_SPELL_EFFECTS) return; SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_dynobject.GetSpellId()); @@ -207,11 +215,12 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target) // Check target immune to spell or aura if (target->IsImmunedToSpell(spellInfo) || target->IsImmunedToSpellEffect(spellInfo, eff_index)) return; - // Apply PersistentAreaAura on target - if(Aura *aur = target->AddAuraEffect(spellInfo, eff_index, &i_dynobject, i_dynobject.GetCaster())) - aur->SetAuraDuration(i_dynobject.GetDuration()); - i_dynobject.AddAffected(target); + // Apply PersistentAreaAura on target + Aura *aur = new Aura(spellInfo, i_dynobject.GetEffectMask(), target, &i_dynobject, i_check); + aur->SetAuraDuration(i_dynobject.GetDuration()); + if(target->AddAura(aur, true)) + i_dynobject.AddAffected(target); } template<> |