*Add DeleteObjectWith owner function for gameobject deletion with updating owner object list

*Cleanups in Aura 1852 and recenlty added glyph code.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-03 14:52:30 +02:00
parent 8777efd03c
commit f93830e0ae
6 changed files with 61 additions and 40 deletions

View File

@@ -434,7 +434,7 @@ void GameObject::Update(uint32 /*p_time*/)
if(GetOwnerGUID())
{
if(Unit* owner = GetOwner())
if(Unit* owner = GetOwner(false))
{
owner->RemoveGameObject(this, false);
SetRespawnTime(0);
@@ -492,6 +492,15 @@ void GameObject::AddUniqueUse(Player* player)
m_unique_users.insert(player->GetGUIDLow());
}
void GameObject::DeleteObjectWithOwner()
{
SetLootState(GO_NOT_READY);
if (GetOwnerGUID())
if (Unit * owner = GetOwner(false))
owner->RemoveGameObject(this, false);
Delete();
}
void GameObject::Delete()
{
assert (!GetOwnerGUID());