Core/Spells: DynamicObject auras will now use the largest radius found in SPELL_EFFECT_PERSISTENT_AREA_AURA effects of the spell creating them
This commit is contained in:
1 parent
71e233eddc
commit
2c2f200e14
1 file changed
+10
-4
@@ -1519,6 +1519,10 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex)
|
|||||||
if (!unitCaster)
|
if (!unitCaster)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Caster not in world, might be spell triggered from aura removal
|
||||||
|
if (!unitCaster->IsInWorld())
|
||||||
|
return;
|
||||||
|
|
||||||
// only handle at last effect
|
// only handle at last effect
|
||||||
for (uint8 i = effIndex + 1; i < MAX_SPELL_EFFECTS; ++i)
|
for (uint8 i = effIndex + 1; i < MAX_SPELL_EFFECTS; ++i)
|
||||||
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA)
|
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA)
|
||||||
@@ -1526,10 +1530,12 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex)
|
|||||||
|
|
||||||
ASSERT(!_dynObjAura);
|
ASSERT(!_dynObjAura);
|
||||||
|
|
||||||
float radius = m_spellInfo->Effects[effIndex].CalcRadius(unitCaster);
|
float radius = 0.0f;
|
||||||
// Caster not in world, might be spell triggered from aura removal
|
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||||
if (!unitCaster->IsInWorld())
|
{
|
||||||
return;
|
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA)
|
||||||
|
radius = std::max(radius, m_spellInfo->Effects[i].CalcRadius(unitCaster));
|
||||||
|
}
|
||||||
|
|
||||||
DynamicObject* dynObj = new DynamicObject(false);
|
DynamicObject* dynObj = new DynamicObject(false);
|
||||||
if (!dynObj->CreateDynamicObject(unitCaster->GetMap()->GenerateLowGuid<HighGuid::DynamicObject>(), unitCaster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL))
|
if (!dynObj->CreateDynamicObject(unitCaster->GetMap()->GenerateLowGuid<HighGuid::DynamicObject>(), unitCaster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL))
|
||||||
|
|||||||
Reference in new issue
Block a user