diff options
author | megamage <none@none> | 2009-02-22 17:35:14 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-22 17:35:14 -0600 |
commit | 107218fe44c5a45023950f11ee3562abfcdd2c95 (patch) | |
tree | 5a3aae5c74723b26cd016596199674af81fa1355 /src/game/DynamicObject.cpp | |
parent | 7190332fcea1dcc6ed8ce59c6bfb542522775e35 (diff) | |
parent | 90d5e05aafff0f3dabd294811b4f82b024317a4a (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/game/DynamicObject.cpp')
-rw-r--r-- | src/game/DynamicObject.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index b63928e7278..ddc04d382de 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -52,15 +52,18 @@ void DynamicObject::AddToWorld() void DynamicObject::RemoveFromWorld() { - // Make sure the object is back to grid container for removal as farsight targets - // are switched to world container on creation and they are also set to active - if (isActive()) + ///- Remove the dynamicObject from the accessor + if(IsInWorld()) { - GetMap()->SwitchGridContainers(this, false); - setActive(false); + // Make sure the object is back to grid container for removal as farsight targets + // are switched to world container on creation and they are also set to active + if (isActive()) + { + GetMap()->SwitchGridContainers(this, false); + setActive(false); + } + ObjectAccessor::Instance().RemoveObject(this); } - ///- Remove the dynamicObject from the accessor - if(IsInWorld()) ObjectAccessor::Instance().RemoveObject(this); WorldObject::RemoveFromWorld(); } |