diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Creature.cpp | 2 | ||||
-rw-r--r-- | src/game/DynamicObject.cpp | 2 | ||||
-rw-r--r-- | src/game/GameObject.cpp | 2 | ||||
-rw-r--r-- | src/game/Pet.cpp | 3 | ||||
-rw-r--r-- | src/game/Vehicle.cpp | 18 |
5 files changed, 15 insertions, 12 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 4e5fca4e9d6..49ec6854e9d 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -185,8 +185,8 @@ void Creature::RemoveFromWorld() { if(m_formationID) formation_mgr.DestroyGroup(m_formationID, GetGUID()); - ObjectAccessor::Instance().RemoveObject(this); Unit::RemoveFromWorld(); + ObjectAccessor::Instance().RemoveObject(this); } } diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 72c1f4b2ce2..93a311bcbe1 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -65,8 +65,8 @@ void DynamicObject::RemoveFromWorld() sLog.outCrash("DynamicObject::RemoveFromWorld cannot find viewpoint owner"); } } - ObjectAccessor::Instance().RemoveObject(this); WorldObject::RemoveFromWorld(); + ObjectAccessor::Instance().RemoveObject(this); } } diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index f75122d888f..eb0dd10b7d4 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -93,8 +93,8 @@ void GameObject::RemoveFromWorld() ///- Remove the gameobject from the accessor if(IsInWorld()) { - ObjectAccessor::Instance().RemoveObject(this); WorldObject::RemoveFromWorld(); + ObjectAccessor::Instance().RemoveObject(this); } } diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index afa9b6eb1c5..b2bc134a2c0 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -85,10 +85,9 @@ void Pet::RemoveFromWorld() ///- Remove the pet from the accessor if(IsInWorld()) { - ///- Remove the pet from the accessor - ObjectAccessor::Instance().RemoveObject(this); ///- Don't call the function for Creature, normal mobs + totems go in a different storage Unit::RemoveFromWorld(); + ObjectAccessor::Instance().RemoveObject(this); } } diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index 1a8118c7990..feffa1b4570 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -37,17 +37,21 @@ Vehicle::~Vehicle() void Vehicle::AddToWorld() { - ///- Register the vehicle for guid lookup - if(!IsInWorld()) ObjectAccessor::Instance().AddObject(this); - Unit::AddToWorld(); + if(!IsInWorld()) + { + ObjectAccessor::Instance().AddObject(this); + Unit::AddToWorld(); + } } void Vehicle::RemoveFromWorld() { - ///- Remove the vehicle from the accessor - if(IsInWorld()) ObjectAccessor::Instance().RemoveObject(this); - ///- Don't call the function for Creature, normal mobs + totems go in a different storage - Unit::RemoveFromWorld(); + if(IsInWorld()) + { + ///- Don't call the function for Creature, normal mobs + totems go in a different storage + Unit::RemoveFromWorld(); + ObjectAccessor::Instance().RemoveObject(this); + } } void Vehicle::setDeathState(DeathState s) // overwrite virtual Creature::setDeathState and Unit::setDeathState |