Add some ASSERT in add/remove obj to/from grid.
This commit is contained in:
@@ -255,6 +255,7 @@ void Map::AddToGrid(Creature* obj, Cell const& cell)
|
||||
obj->SetCurrentCell(cell);
|
||||
}
|
||||
|
||||
//TODO: cell is not needed. Just an unlink is enough.
|
||||
template<class T>
|
||||
void Map::RemoveFromGrid(T* obj, Cell const& cell)
|
||||
{
|
||||
@@ -287,12 +288,12 @@ void Map::SwitchGridContainers(T* obj, bool on)
|
||||
|
||||
if (on)
|
||||
{
|
||||
grid.RemoveGridObject<T>(obj);
|
||||
grid.RemoveGridObject<T>(obj); //not really necessary if there were no ASSERT in remove/add
|
||||
grid.AddWorldObject<T>(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
grid.RemoveWorldObject<T>(obj);
|
||||
grid.RemoveWorldObject<T>(obj); //not really necessary if there were no ASSERT in remove/add
|
||||
grid.AddGridObject<T>(obj);
|
||||
}
|
||||
obj->m_isWorldObject = on;
|
||||
|
||||
Reference in New Issue
Block a user