Skip to content

Commit

Permalink
GridNotifiers: Change to send debug output instead of crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Dec 13, 2024
1 parent c168f55 commit 4518e46
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/game/Grids/GridNotifiers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 4 additions & 0 deletions src/game/Maps/Map.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ class Map : public GridRefManager<NGridType>
#endif

TimePoint GetCurrentClockTime();

// debug
std::set<ObjectGuid> 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);

Expand Down

0 comments on commit 4518e46

Please sign in to comment.