Core/Unit: misc codestyle
use typedef for constant reference
This commit is contained in:
1 parent
fcb7910533
commit
e6bdc58bf0
1 file changed
+11
-11
@@ -7659,13 +7659,13 @@ int32 Unit::SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask) const
|
||||
bool Unit::IsImmunedToDamage(SpellSchoolMask schoolMask) const
|
||||
{
|
||||
// If m_immuneToSchool type contain this school type, IMMUNE damage.
|
||||
auto const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
|
||||
if ((itr->first & schoolMask) != 0)
|
||||
return true;
|
||||
|
||||
// If m_immuneToDamage type contain magic, IMMUNE damage.
|
||||
auto const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
|
||||
SpellImmuneContainer const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
|
||||
for (auto itr = damageList.begin(); itr != damageList.end(); ++itr)
|
||||
if ((itr->first & schoolMask) != 0)
|
||||
return true;
|
||||
@@ -7677,13 +7677,13 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const
|
||||
{
|
||||
uint32 schoolMask = spellInfo->GetSchoolMask();
|
||||
// If m_immuneToSchool type contain this school type, IMMUNE damage.
|
||||
auto const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
|
||||
if ((itr->first & schoolMask) && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->second)))
|
||||
return true;
|
||||
|
||||
// If m_immuneToDamage type contain magic, IMMUNE damage.
|
||||
auto const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
|
||||
SpellImmuneContainer const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
|
||||
for (auto itr = damageList.begin(); itr != damageList.end(); ++itr)
|
||||
if ((itr->first & schoolMask) != 0)
|
||||
return true;
|
||||
@@ -7697,7 +7697,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
|
||||
return false;
|
||||
|
||||
// Single spell immunity.
|
||||
auto const& idList = m_spellImmune[IMMUNITY_ID];
|
||||
SpellImmuneContainer const& idList = m_spellImmune[IMMUNITY_ID];
|
||||
if (idList.count(spellInfo->Id) > 0)
|
||||
return true;
|
||||
|
||||
@@ -7706,7 +7706,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
|
||||
|
||||
if (uint32 dispel = spellInfo->Dispel)
|
||||
{
|
||||
auto const& dispelList = m_spellImmune[IMMUNITY_DISPEL];
|
||||
SpellImmuneContainer const& dispelList = m_spellImmune[IMMUNITY_DISPEL];
|
||||
if (dispelList.count(dispel) > 0)
|
||||
return true;
|
||||
}
|
||||
@@ -7714,7 +7714,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
|
||||
// Spells that don't have effectMechanics.
|
||||
if (uint32 mechanic = spellInfo->Mechanic)
|
||||
{
|
||||
auto const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
|
||||
SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
|
||||
if (mechanicList.count(mechanic) > 0)
|
||||
return true;
|
||||
}
|
||||
@@ -7734,7 +7734,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
|
||||
if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects.
|
||||
return true;
|
||||
|
||||
auto const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
|
||||
{
|
||||
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second);
|
||||
@@ -7750,7 +7750,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
|
||||
uint32 Unit::GetSchoolImmunityMask() const
|
||||
{
|
||||
uint32 mask = 0;
|
||||
auto const& mechanicList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||
for (auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
|
||||
mask |= itr->first;
|
||||
|
||||
@@ -7760,7 +7760,7 @@ uint32 Unit::GetSchoolImmunityMask() const
|
||||
uint32 Unit::GetMechanicImmunityMask() const
|
||||
{
|
||||
uint32 mask = 0;
|
||||
auto const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
|
||||
SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
|
||||
for (auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
|
||||
mask |= (1 << itr->first);
|
||||
|
||||
@@ -7792,7 +7792,7 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons
|
||||
{
|
||||
if (!spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
|
||||
{
|
||||
auto const& list = m_spellImmune[IMMUNITY_STATE];
|
||||
SpellImmuneContainer const& list = m_spellImmune[IMMUNITY_STATE];
|
||||
if (list.count(aura) > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user