From 5032bd159cc0fff5e10d38161ecb5e7469c3d75f Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 12 Apr 2009 16:44:44 -0500 Subject: *Add better debug log for grid state. --HG-- branch : trunk --- src/game/GridStates.cpp | 3 ++- src/game/Map.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/GridStates.cpp b/src/game/GridStates.cpp index fa1c0a2b534..36092fbdc29 100644 --- a/src/game/GridStates.cpp +++ b/src/game/GridStates.cpp @@ -40,6 +40,7 @@ ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 &x, c ObjectGridStoper stoper(grid); stoper.StopN(); grid.SetGridState(GRID_STATE_IDLE); + sLog.outDebug("Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId()); } else { @@ -53,7 +54,7 @@ IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 &x, const ui { m.ResetGridExpiry(grid); grid.SetGridState(GRID_STATE_REMOVAL); - sLog.outDebug("Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId()); + sLog.outDebug("Grid[%u,%u] on map %u moved to REMOVAL state", x, y, m.GetId()); } void diff --git a/src/game/Map.cpp b/src/game/Map.cpp index b7e0fd59f61..b12c7b477c0 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -410,6 +410,8 @@ Map::EnsureGridCreated(const GridPair &p) Guard guard(*this); if(!getNGrid(p.x_coord, p.y_coord)) { + sLog.outDebug("Loading grid[%u,%u] for map %u", p.x_coord, p.y_coord, i_id); + setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld.getConfig(CONFIG_GRID_UNLOAD)), p.x_coord, p.y_coord); @@ -1139,7 +1141,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) if(!unloadAll && ActiveObjectsNearGrid(x, y) ) return false; - DEBUG_LOG("Unloading grid[%u,%u] for map %u", x,y, i_id); + sLog.outDebug("Unloading grid[%u,%u] for map %u", x,y, i_id); ObjectGridUnloader unloader(*grid); -- cgit v1.2.3