mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Do not allow units that are not in world to create dynamic objects from spell effect handlers
--HG-- branch : trunk
This commit is contained in:
@@ -3117,6 +3117,9 @@ void Spell::EffectPersistentAA(uint32 i)
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius);
|
||||
|
||||
Unit *caster = m_caster->GetEntry() == WORLD_TRIGGER ? m_originalCaster : m_caster;
|
||||
// Caster not in world, might be spell triggered from aura removal
|
||||
if (!caster->IsInWorld())
|
||||
return;
|
||||
DynamicObject* dynObj = new DynamicObject;
|
||||
if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, m_targets.m_dstPos, radius, false))
|
||||
{
|
||||
@@ -3874,6 +3877,9 @@ void Spell::EffectAddFarsight(uint32 i)
|
||||
|
||||
float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
int32 duration = GetSpellDuration(m_spellInfo);
|
||||
// Caster not in world, might be spell triggered from aura removal
|
||||
if (!m_caster->IsInWorld())
|
||||
return;
|
||||
DynamicObject* dynObj = new DynamicObject;
|
||||
if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, m_targets.m_dstPos, radius, true))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user