From 33efe96f946c3a8e9473f399abf42d2245bc0097 Mon Sep 17 00:00:00 2001 From: QAston Date: Thu, 30 Jul 2009 11:45:51 +0200 Subject: Backed out changeset 9b89f42ffbd8 - mangos [8219] --HG-- branch : trunk --- src/game/SpellEffects.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/game/SpellEffects.cpp') diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 89845a51bd0..7523664c8b1 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5873,10 +5873,20 @@ void Spell::EffectSummonObject(uint32 i) default: return; } - if(uint64 guid = m_caster->m_ObjectSlot[slot]) + uint64 guid = m_caster->m_ObjectSlot[slot]; + if(guid != 0) { - if(GameObject* obj = m_caster ? m_caster->GetMap()->GetGameObject(guid) : NULL) - obj->SetLootState(GO_JUST_DEACTIVATED); + GameObject* obj = NULL; + if( m_caster ) + obj = m_caster->GetMap()->GetGameObject(guid); + + if(obj) + { + // Recast case - null spell id to make auras not be removed on object remove from world + if (m_spellInfo->Id == obj->GetSpellId()) + obj->SetSpellId(0); + m_caster->RemoveGameObject(obj, true); + } m_caster->m_ObjectSlot[slot] = 0; } -- cgit v1.2.3