aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.cpp
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.cpp
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.cpp')
-rw-r--r--src/server/game/Maps/Map.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 1fc947a43c2..a206b6529d0 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -534,11 +534,11 @@ bool Map::EnsureGridLoaded(Cell const& cell)
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(grid != nullptr);
- if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY()))
+ if (!grid->isGridObjectDataLoaded())
{
TC_LOG_DEBUG("maps", "Loading grid[%u, %u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId);
- setGridObjectDataLoaded(true, cell.GridX(), cell.GridY());
+ grid->setGridObjectDataLoaded(true);
ObjectGridLoader loader(*grid, this, cell);
loader.LoadN();
@@ -709,7 +709,8 @@ bool Map::AddToMap(Transport* obj)
bool Map::IsGridLoaded(GridCoord const& p) const
{
- return (getNGrid(p.x_coord, p.y_coord) && isGridObjectDataLoaded(p.x_coord, p.y_coord));
+ NGridType* grid = getNGrid(p.x_coord, p.y_coord);
+ return grid && grid->isGridObjectDataLoaded();
}
void Map::VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor<Trinity::ObjectUpdater, GridTypeMapContainer> &gridVisitor, TypeContainerVisitor<Trinity::ObjectUpdater, WorldTypeMapContainer> &worldVisitor)