Add some ASSERT in add/remove obj to/from grid.

This commit is contained in:
megamage
2011-11-10 10:18:32 -05:00
parent 7c1f1b3898
commit 23b3f16f3a
3 changed files with 18 additions and 10 deletions
+3 -2
View File
@@ -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;