diff --git a/src/game/Grids/GridNotifiers.cpp b/src/game/Grids/GridNotifiers.cpp index 67e885848..34c562177 100644 --- a/src/game/Grids/GridNotifiers.cpp +++ b/src/game/Grids/GridNotifiers.cpp @@ -64,7 +64,8 @@ void VisibleNotifier::Notify() player.RemoveAtClient(target); } else - MANGOS_ASSERT(false); // memleak + sLog.outCustomLog("Object was %s in current map.", player.GetMap()->m_objRemoveList.find(*itr) == player.GetMap()->m_objRemoveList.end() ? "not found" : "found"); + //MANGOS_ASSERT(false); // memleak DEBUG_FILTER_LOG(LOG_FILTER_VISIBILITY_CHANGES, "%s is out of range (no in active cells set) now for %s", diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index c9d9ec164..0180fdf05 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -734,6 +734,8 @@ Map::Remove(T* obj, bool remove) UpdateObjectVisibility(obj, cell, p); // i think will be better to call this function while object still in grid, this changes nothing but logically is better(as for me) RemoveFromGrid(obj, grid, cell); + m_objRemoveList.insert(obj->GetObjectGuid()); + obj->ResetMap(); if (remove) { diff --git a/src/game/Maps/Map.h b/src/game/Maps/Map.h index d056fdd09..17b97ae77 100644 --- a/src/game/Maps/Map.h +++ b/src/game/Maps/Map.h @@ -335,6 +335,10 @@ class Map : public GridRefManager #endif TimePoint GetCurrentClockTime(); + + // debug + std::set m_objRemoveList; // this will eventually eat up too much memory - only used for debugging VisibleNotifier::Notify() customlog leak + private: void LoadMapAndVMap(int gx, int gy);