From ffdfd9252ba04075a0662cb1eba4383409fd8a60 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 18 Oct 2011 11:51:30 -0400 Subject: More clean up of grid system. --- src/server/game/Maps/Map.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/server/game/Maps/Map.h') diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 7dd7faedec2..33d898d1af7 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -267,10 +267,9 @@ class Map : public GridRefManager return !getNGrid(p.x_coord, p.y_coord) || getNGrid(p.x_coord, p.y_coord)->GetGridState() == GRID_STATE_REMOVAL; } - bool IsLoaded(float x, float y) const + bool IsGridLoaded(float x, float y) const { - GridCoord p = Trinity::ComputeGridCoord(x, y); - return loaded(p); + return IsGridLoaded(Trinity::ComputeGridCoord(x, y)); } bool GetUnloadLock(const GridCoord &p) const { return getNGrid(p.x_coord, p.y_coord)->getUnloadLock(); } @@ -447,10 +446,10 @@ class Map : public GridRefManager bool _creatureToMoveLock; std::vector _creaturesToMove; - bool loaded(const GridCoord &) const; + bool IsGridLoaded(const GridCoord &) const; void EnsureGridCreated(const GridCoord &); bool EnsureGridLoaded(Cell const&); - void EnsureGridLoadedAtEnter(Cell const&, Player* player = NULL); + void EnsureGridLoadedForActiveObject(Cell const&, WorldObject* object); void buildNGridLinkage(NGridType* pNGridType) { pNGridType->link(this); } @@ -524,10 +523,10 @@ class Map : public GridRefManager // Type specific code for add/remove to/from grid template - void AddToGrid(T*, NGridType *, Cell const&); + void AddToGrid(T* object, Cell const& cell); template - void RemoveFromGrid(T*, NGridType *, Cell const&); + void RemoveFromGrid(T* object, Cell const& cell); template void DeleteFromWorld(T*); @@ -624,7 +623,7 @@ Map::Visit(const Cell& cell, TypeContainerVisitor &visitor) const uint32 cell_x = cell.CellX(); const uint32 cell_y = cell.CellY(); - if (!cell.NoCreate() || loaded(GridCoord(x, y))) + if (!cell.NoCreate() || IsGridLoaded(GridCoord(x, y))) { EnsureGridLoaded(cell); getNGrid(x, y)->Visit(cell_x, cell_y, visitor); -- cgit v1.2.3