From a29847bf8490833ba219f01fba1441d6c8f1b7a3 Mon Sep 17 00:00:00 2001 From: krz Date: Tue, 2 Jun 2009 20:59:13 +0200 Subject: Fix for some combat log errors. Only Vanish and Invisibility auras will now prevent from taking damage if target is not visible for caster. --HG-- branch : trunk --- src/game/Unit.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6f248b75161..2ec904dd865 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -616,6 +616,17 @@ bool Unit::HasAuraType(AuraType auraType) const return (!m_modAuras[auraType].empty()); } +bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName ,uint64 familyFlags) const +{ + if(!HasAuraType(auraType)) return false; + AuraList const &auras = GetAurasByType(auraType); + for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + if(SpellEntry const *iterSpellProto = (*itr)->GetSpellProto()) + if(iterSpellProto->SpellFamilyName == familyName && iterSpellProto->SpellFamilyFlags & 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) { -- cgit v1.2.3