mirror of
https://github.com/mangosfour/server.git
synced 2025-12-19 13:37:01 +00:00
[11375] Move holder-wide code from effect loop in immune cast checks.
This commit is contained in:
parent
79cd96af8a
commit
c6dee6c2d6
2 changed files with 40 additions and 39 deletions
|
|
@ -5714,20 +5714,22 @@ SpellCastResult Spell::CheckCasterAuras() const
|
|||
Unit::SpellAuraHolderMap const& auras = m_caster->GetSpellAuraHolderMap();
|
||||
for(Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
if (SpellAuraHolder *holder = itr->second)
|
||||
{
|
||||
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
{
|
||||
SpellAuraHolder *holder = itr->second;
|
||||
SpellEntry const * pEntry = holder->GetSpellProto();
|
||||
if (GetSpellMechanicMask(pEntry, 1 << i) & mechanic_immune)
|
||||
continue;
|
||||
|
||||
if ((GetSpellSchoolMask(pEntry) & school_immune) && !(pEntry->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE))
|
||||
continue;
|
||||
if ((1<<(pEntry->Dispel)) & dispel_immune)
|
||||
continue;
|
||||
|
||||
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
{
|
||||
Aura *aura = holder->GetAuraByEffectIndex(SpellEffectIndex(i));
|
||||
if (!aura)
|
||||
continue;
|
||||
|
||||
if (GetSpellMechanicMask(pEntry, 1 << i) & mechanic_immune)
|
||||
continue;
|
||||
// Make a second check for spell failed so the right SPELL_FAILED message is returned.
|
||||
// That is needed when your casting is prevented by multiple states and you are only immune to some of them.
|
||||
switch(aura->GetModifier()->m_auraname)
|
||||
|
|
@ -5757,7 +5759,6 @@ SpellCastResult Spell::CheckCasterAuras() const
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// You are prevented from casting and the spell casted does not grant immunity. Return a failed error.
|
||||
else
|
||||
return prevented_reason;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11374"
|
||||
#define REVISION_NR "11375"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue