aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-01-13 15:02:07 +0100
committerOvahlord <dreadkiller@gmx.de>2025-01-13 19:31:20 +0100
commitf02d30be65459540b0d07f6e774bf2e02e18c42c (patch)
treecaf565a3e212389ac0e8b7e96ef3bd3bd2a7a068
parent7aac50c888109182ab6e7871610124b17a0f54d1 (diff)
Core/Spells: DynamicObject auras will now use the largest radius found in SPELL_EFFECT_PERSISTENT_AREA_AURA effects of the spell creating them
(cherry picked from commit 4bec94451fb239a4e2007413b5691ed19fea6981) (cherry picked from commit 497cb7df49550c2420ce8729254cc120d3290d2e)
-rw-r--r--src/server/game/Spells/SpellEffects.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 218b83bff43..ddb2675633b 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1485,6 +1485,10 @@ void Spell::EffectPersistentAA()
if (!unitCaster)
return;
+ // Caster not in world, might be spell triggered from aura removal
+ if (!unitCaster->IsInWorld())
+ return;
+
// only handle at last effect
for (size_t i = effectInfo->EffectIndex + 1; i < m_spellInfo->GetEffects().size(); ++i)
if (m_spellInfo->GetEffect(SpellEffIndex(i)).IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA))
@@ -1492,11 +1496,13 @@ void Spell::EffectPersistentAA()
ASSERT(!_dynObjAura);
- float radius = effectInfo->CalcRadius(unitCaster);
-
- // Caster not in world, might be spell triggered from aura removal
- if (!unitCaster->IsInWorld())
- return;
+ float radius = 0.0f;
+ for (size_t i = 0; i <= effectInfo->EffectIndex; ++i)
+ {
+ SpellEffectInfo const& spellEffectInfo = m_spellInfo->GetEffect(SpellEffIndex(i));
+ if (spellEffectInfo.IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA))
+ radius = std::max(radius, spellEffectInfo.CalcRadius(unitCaster));
+ }
DynamicObject* dynObj = new DynamicObject(false);
if (!dynObj->CreateDynamicObject(unitCaster->GetMap()->GenerateLowGuid<HighGuid::DynamicObject>(), unitCaster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL, m_SpellVisual))