Skip to content

Commit

Permalink
Merge 3.3.5 to npcbots_3.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Jan 17, 2025
2 parents c39b35e + 4bec944 commit de09d1e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/server/game/Spells/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1725,18 +1725,24 @@ 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))
return;

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->Id, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL))
Expand Down

0 comments on commit de09d1e

Please sign in to comment.