[11633] Implement function Unit::HasAffectedAura

This commit is contained in:
zergtmn 2011-06-17 22:06:12 +06:00
parent 54f623d2b8
commit 3443a97a28
5 changed files with 27 additions and 24 deletions

View file

@ -488,11 +488,6 @@ void Unit::RemoveSpellsCausingAura(AuraType auraType, SpellAuraHolder* except)
}
}
bool Unit::HasAuraType(AuraType auraType) const
{
return (!m_modAuras[auraType].empty());
}
/* Called by DealDamage for auras that have a chance to be dispelled on damage taken. */
void Unit::RemoveSpellbyDamageTaken(AuraType auraType, uint32 damage)
{
@ -4919,6 +4914,24 @@ void Unit::_ApplyAllAuraMods()
}
}
bool Unit::HasAuraType(AuraType auraType) const
{
return !GetAurasByType(auraType).empty();
}
bool Unit::HasAffectedAura(AuraType auraType, SpellEntry const* spellProto) const
{
Unit::AuraList const& auras = GetAurasByType(auraType);
for (Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
if ((*itr)->isAffectedOnSpell(spellProto))
return true;
}
return false;
}
Aura* Unit::GetAura(uint32 spellId, SpellEffectIndex effindex)
{
SpellAuraHolderBounds bounds = GetSpellAuraHolderBounds(spellId);