From 04ad59f06c5a3cc6662fcb13d5d2adb5d70b05bf Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 29 Aug 2009 22:38:40 +0400 Subject: [PATCH] [8437] Remove redundent player typeid check. --- src/game/SpellAuras.cpp | 19 ++++++++++--------- src/shared/revision_nr.h | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 4fe953a79..c281e0320 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1254,13 +1254,17 @@ void Aura::ReapplyAffectedPassiveAuras( Unit* target ) std::set affectedPassives; for(Unit::AuraMap::const_iterator itr = target->GetAuras().begin(); itr != target->GetAuras().end(); ++itr) + { // permanent passive if (itr->second->IsPassive() && itr->second->IsPermanent() && // non deleted and not same aura (any with same spell id) !itr->second->IsDeleted() && itr->second->GetId() != GetId() && // only applied by self and affected by aura itr->second->GetCasterGUID() == target->GetGUID() && isAffectedOnSpell(itr->second->GetSpellProto())) + { affectedPassives.insert(itr->second->GetId()); + } + } for(std::set::const_iterator set_itr = affectedPassives.begin(); set_itr != affectedPassives.end(); ++set_itr) { @@ -1329,16 +1333,13 @@ void Aura::HandleAddModifier(bool apply, bool Real) ReapplyAffectedPassiveAuras(m_target); // re-aplly talents and passives applied to pet (it affected by player spellmods) - if (m_target->GetTypeId() == TYPEID_PLAYER) - { - if(Pet* pet = m_target->GetPet()) - ReapplyAffectedPassiveAuras(pet); + if(Pet* pet = m_target->GetPet()) + ReapplyAffectedPassiveAuras(pet); - for(int i = 0; i < MAX_TOTEM; ++i) - if(m_target->m_TotemSlot[i]) - if(Creature* totem = m_target->GetMap()->GetCreature(m_target->m_TotemSlot[i])) - ReapplyAffectedPassiveAuras(totem); - } + for(int i = 0; i < MAX_TOTEM; ++i) + if(m_target->m_TotemSlot[i]) + if(Creature* totem = m_target->GetMap()->GetCreature(m_target->m_TotemSlot[i])) + ReapplyAffectedPassiveAuras(totem); } void Aura::HandleAddTargetTrigger(bool apply, bool /*Real*/) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7597af264..83212e8d3 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8436" + #define REVISION_NR "8437" #endif // __REVISION_NR_H__ -- 2.11.4.GIT