aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-08-03 14:52:30 +0200
committerQAston <none@none>2009-08-03 14:52:30 +0200
commitf93830e0ae96be348638c51918df754ee408e16d (patch)
tree9328199e150c4378c21c59cde3cf207e1076811b /src/game/GameObject.cpp
parent8777efd03cbad7036c371c88b0212e8425c5bf59 (diff)
*Add DeleteObjectWith owner function for gameobject deletion with updating owner object list
*Cleanups in Aura 1852 and recenlty added glyph code. --HG-- branch : trunk
Diffstat (limited to 'src/game/GameObject.cpp')
-rw-r--r--src/game/GameObject.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index f934d3d1fe7..457591e63b4 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -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());