mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[7497] Remove auras from GO owner at remove connected owned th this spell GO.
This commit is contained in:
parent
ae104fea27
commit
4bc5bf3877
2 changed files with 18 additions and 10 deletions
|
|
@ -4082,17 +4082,25 @@ void Unit::RemoveGameObject(GameObject* gameObj, bool del)
|
||||||
{
|
{
|
||||||
assert(gameObj && gameObj->GetOwnerGUID()==GetGUID());
|
assert(gameObj && gameObj->GetOwnerGUID()==GetGUID());
|
||||||
|
|
||||||
// GO created by some spell
|
|
||||||
if ( GetTypeId()==TYPEID_PLAYER && 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);
|
|
||||||
}
|
|
||||||
gameObj->SetOwnerGUID(0);
|
gameObj->SetOwnerGUID(0);
|
||||||
|
|
||||||
|
// GO created by some spell
|
||||||
|
if (uint32 spellid = gameObj->GetSpellId())
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_gameObj.remove(gameObj);
|
m_gameObj.remove(gameObj);
|
||||||
|
|
||||||
if(del)
|
if(del)
|
||||||
{
|
{
|
||||||
gameObj->SetRespawnTime(0);
|
gameObj->SetRespawnTime(0);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7496"
|
#define REVISION_NR "7497"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue