aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorthenecromancer <none@none>2010-01-24 23:47:17 +0100
committerthenecromancer <none@none>2010-01-24 23:47:17 +0100
commit73dd5925be1f0405acbc1f05bd3e13a19a2a5e8d (patch)
tree9dcc3c90b5c1cdc97a842fa9a0d310f7ad40502b /src
parent9d59288b1dfda9f647b2d46f4ef48c879cd208c0 (diff)
Do not allow units that are not in world to create dynamic objects from spell effect handlers
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellEffects.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 283de99612c..6d16cba265b 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -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))
{