Core/Auras: Minor optimization for Unit object creation with msvc (not allocating a list end sentinel node for all of the 500 lists stored in Unit for each aura type)
This commit is contained in:
1 parent
406d76e079
commit
4ead80f388
10 files changed
+127
-57
No files matched your search
@@ -508,7 +508,7 @@ public:
|
||||
if (auraList.empty())
|
||||
continue;
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, auraList.size(), i);
|
||||
handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, std::to_string(std::distance(auraList.begin(), auraList.end())).c_str(), i);
|
||||
|
||||
for (Unit::AuraEffectList::const_iterator itr = auraList.begin(); itr != auraList.end(); ++itr)
|
||||
handler->PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(), (*itr)->GetAmount());
|
||||
|
||||
@@ -2951,7 +2951,8 @@ class spell_gen_two_forms : public SpellScript
|
||||
}
|
||||
|
||||
// Player cannot transform to human form if he is forced to be worgen for some reason (Darkflight)
|
||||
if (GetCaster()->GetAuraEffectsByType(SPELL_AURA_WORGEN_ALTERED_FORM).size() > 1)
|
||||
Unit::AuraEffectList const& alteredFormAuras = GetCaster()->GetAuraEffectsByType(SPELL_AURA_WORGEN_ALTERED_FORM);
|
||||
if (std::distance(alteredFormAuras.begin(), alteredFormAuras.end()) > 1)
|
||||
{
|
||||
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TRANSFORM);
|
||||
return SPELL_FAILED_CUSTOM_ERROR;
|
||||
|
||||
@@ -1623,7 +1623,7 @@ private:
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
std::list<AuraEffect*> dotAuraEffects = target->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
Unit::AuraEffectList const& dotAuraEffects = target->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
if (dotAuraEffects.empty())
|
||||
return false;
|
||||
|
||||
@@ -1665,7 +1665,7 @@ class spell_mage_impact_triggered : public SpellScript
|
||||
if (!target || !caster || target != launchTarget)
|
||||
return;
|
||||
|
||||
std::list<AuraEffect*> dotAuraEffects = target->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
Unit::AuraEffectList const& dotAuraEffects = target->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
if (dotAuraEffects.empty())
|
||||
return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user