*Add better debug log for grid state.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-12 16:44:44 -05:00
parent 74977d73f3
commit 5032bd159c
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -40,6 +40,7 @@ ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 &x, c
ObjectGridStoper stoper(grid); ObjectGridStoper stoper(grid);
stoper.StopN(); stoper.StopN();
grid.SetGridState(GRID_STATE_IDLE); grid.SetGridState(GRID_STATE_IDLE);
sLog.outDebug("Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId());
} }
else else
{ {
@@ -53,7 +54,7 @@ IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 &x, const ui
{ {
m.ResetGridExpiry(grid); m.ResetGridExpiry(grid);
grid.SetGridState(GRID_STATE_REMOVAL); 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 void
+3 -1
View File
@@ -410,6 +410,8 @@ Map::EnsureGridCreated(const GridPair &p)
Guard guard(*this); Guard guard(*this);
if(!getNGrid(p.x_coord, p.y_coord)) 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)), 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); 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) ) if(!unloadAll && ActiveObjectsNearGrid(x, y) )
return false; 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); ObjectGridUnloader unloader(*grid);