diff options
author | megamage <none@none> | 2009-06-07 11:36:41 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-07 11:36:41 -0500 |
commit | c48c20cb9866d22f1b03159ae258310ab10a9263 (patch) | |
tree | 9bff30e856003bb7be850979409906007dc34893 /src/game/Unit.cpp | |
parent | 73299773235259a2bd2272f0c54b01a2435b7a01 (diff) | |
parent | a29847bf8490833ba219f01fba1441d6c8f1b7a3 (diff) |
*Merge. Note: A better way is needed for Sanctuary effect. (interrupt all spells towards self).
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index d614b743b7b..13e0575d2ed 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -513,6 +513,17 @@ void Unit::UpdateInterruptMask() m_interruptMask |= spell->m_spellInfo->ChannelInterruptFlags; } +bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const +{ + if(!HasAuraType(auraType)) return false; + AuraEffectList const &auras = GetAurasByType(auraType); + for(AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + if(SpellEntry const *iterSpellProto = (*itr)->GetSpellProto()) + if(iterSpellProto->SpellFamilyName == familyName && iterSpellProto->SpellFamilyFlags[0] & familyFlags) + return true; + return false; +} + /* Called by DealDamage for auras that have a chance to be dispelled on damage taken. */ void Unit::RemoveSpellbyDamageTaken(uint32 damage, uint32 spell) { |