diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 6bd94c11a7..d56593435a 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -450,24 +450,26 @@ AuraEffect::~AuraEffect() delete m_spellmod; } -void AuraEffect::GetTargetList(std::list & targetList) const +template +void AuraEffect::GetTargetList(Container& targetContainer) const { - Aura::ApplicationMap const & targetMap = GetBase()->GetApplicationMap(); + Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap(); // remove all targets which were not added to new list - they no longer deserve area aura - for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter) + for (auto appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter) { if (appIter->second->HasEffect(GetEffIndex())) - targetList.push_back(appIter->second->GetTarget()); + targetContainer.push_back(appIter->second->GetTarget()); } } -void AuraEffect::GetApplicationList(std::list & applicationList) const +template +void AuraEffect::GetApplicationList(Container& applicationContainer) const { - Aura::ApplicationMap const & targetMap = GetBase()->GetApplicationMap(); - for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter) + Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap(); + for (auto appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter) { if (appIter->second->HasEffect(GetEffIndex())) - applicationList.push_back(appIter->second); + applicationContainer.push_back(appIter->second); } } @@ -6168,3 +6170,11 @@ void AuraEffect::HandleModSpellCategoryCooldown(AuraApplication const* aurApp, u if (Player* player = aurApp->GetTarget()->ToPlayer()) player->SendSpellCategoryCooldowns(); } + +template TC_GAME_API void AuraEffect::GetTargetList(std::list&) const; +template TC_GAME_API void AuraEffect::GetTargetList(std::deque&) const; +template TC_GAME_API void AuraEffect::GetTargetList(std::vector&) const; + +template TC_GAME_API void AuraEffect::GetApplicationList(std::list&) const; +template TC_GAME_API void AuraEffect::GetApplicationList(std::deque&) const; +template TC_GAME_API void AuraEffect::GetApplicationList(std::vector&) const; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 1b1d59dd9e..a93b16e1f8 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -39,8 +39,13 @@ class TC_GAME_API AuraEffect Unit* GetCaster() const { return GetBase()->GetCaster(); } ObjectGuid GetCasterGUID() const { return GetBase()->GetCasterGUID(); } Aura* GetBase() const { return m_base; } - void GetTargetList(std::list & targetList) const; - void GetApplicationList(std::list & applicationList) const; + + template + void GetTargetList(Container& targetContainer) const; + + template + void GetApplicationList(Container& applicationContainer) const; + SpellModifier* GetSpellModifier() const { return m_spellmod; } SpellInfo const* GetSpellInfo() const { return m_spellInfo; }