diff options
author | megamage <none@none> | 2009-03-19 15:18:49 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-19 15:18:49 -0600 |
commit | e121267298b9147df9f9a8d411ee446c24011d15 (patch) | |
tree | 478fb37cec1cd2289d72faadcf012666bfa888f8 /src/game/Unit.cpp | |
parent | 64ce6533a9b5f89336b9a637a33b18230f0a79d8 (diff) |
[7497] Remove auras from GO owner at remove connected owned th this spell GO. Author: VladimirMangos
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e037c17bead..e745aec5d6f 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4632,17 +4632,25 @@ void Unit::RemoveGameObject(GameObject* gameObj, bool del) { assert(gameObj && gameObj->GetOwnerGUID()==GetGUID()); + gameObj->SetOwnerGUID(0); + // GO created by some spell - if ( GetTypeId()==TYPEID_PLAYER && gameObj->GetSpellId() ) + if (uint32 spellid = gameObj->GetSpellId()) { - SpellEntry const* createBySpell = sSpellStore.LookupEntry(gameObj->GetSpellId()); - // Need activate spell use for owner - if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) - // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases) - ((Player*)this)->SendCooldownEvent(createBySpell); + RemoveAurasDueToSpell(spellid); + + if (GetTypeId()==TYPEID_PLAYER) + { + SpellEntry const* createBySpell = sSpellStore.LookupEntry(spellid ); + // Need activate spell use for owner + if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) + // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases) + ((Player*)this)->SendCooldownEvent(createBySpell); + } } - gameObj->SetOwnerGUID(0); + m_gameObj.remove(gameObj); + if(del) { gameObj->SetRespawnTime(0); |