[svn] Fixed freeze caused by dynamic objects (hopefully).

--HG--
branch : trunk
This commit is contained in:
gvcoman
2008-11-15 13:34:59 -06:00
parent 8df6868fac
commit 61d9723c5b

View File

@@ -137,8 +137,12 @@ void DynamicObject::Update(uint32 p_time)
void DynamicObject::Delete()
{
// Make sure the object is back to grid container for removal as farsight targets
// are switched to world container on creation
GetMap()->SwitchGridContainers(this, false);
// are switched to world container on creation and they are also set to active
if (isActive())
{
GetMap()->SwitchGridContainers(this, false);
setActive(false);
}
SendObjectDeSpawnAnim(GetGUID());
AddObjectToRemoveList();
}