aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.h
diff options
context:
space:
mode:
authorGosha <284210+Lordron@users.noreply.github.com>2023-04-13 12:52:34 +0300
committerGitHub <noreply@github.com>2023-04-13 11:52:34 +0200
commit71b7cc6361d6db9dd445aef617a40b8435393729 (patch)
tree0d04f46627d1288b9a0e641f0800488f6a3fc919 /src/server/game/Maps/Map.h
parent9ad420e5318c8cda8b133e65fe7162b1976c0ae8 (diff)
Change Map::Visit to not call EnsureGridLoaded if cell.NoCreate is true (#28884)
Remove Map::setGridObjectDataLoaded/Map::isGridObjectDataLoaded helpers, we have NGridType object to use methods directly
Diffstat (limited to 'src/server/game/Maps/Map.h')
-rw-r--r--src/server/game/Maps/Map.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index c926a00f27f..66c8e0c9059 100644
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -696,9 +696,6 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
return i_grids[x][y];
}
- bool isGridObjectDataLoaded(uint32 x, uint32 y) const { return getNGrid(x, y)->isGridObjectDataLoaded(); }
- void setGridObjectDataLoaded(bool pLoaded, uint32 x, uint32 y) { getNGrid(x, y)->setGridObjectDataLoaded(pLoaded); }
-
void setNGrid(NGridType* grid, uint32 x, uint32 y);
void ScriptsProcess();
@@ -985,10 +982,11 @@ inline void Map::Visit(Cell const& cell, TypeContainerVisitor<T, CONTAINER>& vis
const uint32 cell_x = cell.CellX();
const uint32 cell_y = cell.CellY();
- if (!cell.NoCreate() || IsGridLoaded(GridCoord(x, y)))
- {
+ if (!cell.NoCreate())
EnsureGridLoaded(cell);
- getNGrid(x, y)->VisitGrid(cell_x, cell_y, visitor);
- }
+
+ NGridType* grid = getNGrid(x, y);
+ if (grid && grid->isGridObjectDataLoaded())
+ grid->VisitGrid(cell_x, cell_y, visitor);
}
#endif