aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-08-18 18:23:29 +0200
committerShauren <shauren.trinity@gmail.com>2023-08-18 18:23:29 +0200
commit9e1b97900eaf7dae656b2df187a4327b1f4d324d (patch)
tree5442b0a5380fb26c37dc152202283ff55c849909 /src/server/scripts/Spells
parente851902054ecab52c063a8a53854fc7ef8116297 (diff)
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)
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 131fd6bc8b5..273be7a68bb 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3121,7 +3121,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;