mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
*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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user