[11980] Improve support for wild summoned GOs

* Support GetGameObject for wild summoned GOs
* Proper delete WildSummoned GOs after they are used
This commit is contained in:
Schmoozerd 2011-03-22 22:14:20 +01:00 committed by Schmoozerd
parent c17fdc3093
commit d08edbd93c
5 changed files with 44 additions and 11 deletions

View file

@ -401,10 +401,11 @@ void GameObject::Update(uint32 update_diff, uint32 /*p_time*/)
//any return here in case battleground traps
}
if (GetOwnerGuid())
if (!HasStaticDBSpawnData()) // Remove wild summoned after use
{
if (Unit* owner = GetOwner())
owner->RemoveGameObject(this, false);
if (GetOwnerGuid())
if (Unit* owner = GetOwner())
owner->RemoveGameObject(this, false);
SetRespawnTime(0);
Delete();