Fix the crash when removing object from an unloaded grid. Object should always be unlinked from grid no matter if the grid is loaded.

This commit is contained in:
megamage
2011-11-10 17:31:45 -05:00
parent 23b3f16f3a
commit 31a88d4fe5
6 changed files with 51 additions and 95 deletions

View File

@@ -77,7 +77,7 @@ template<> void ObjectGridLoader::SetObjectCell(Creature* obj, CellCoord const&
template <class T>
void AddObjectHelper(CellCoord &cell, GridRefManager<T> &m, uint32 &count, Map* map, T *obj)
{
obj->GetGridRef().link(&m, obj);
obj->AddToGrid(m);
ObjectGridLoader::SetObjectCell(obj, cell);
obj->AddToWorld();
if (obj->isActiveObject())