feat(Core/Config): Add parameter to load all grids of all non-instanced maps on server start (#2283)

This commit is contained in:
Stoabrogga
2019-09-30 17:06:32 +02:00
committed by GitHub
parent 439bcbda19
commit ab55aa4e5a
5 changed files with 45 additions and 16 deletions

View File

@@ -469,6 +469,13 @@ void Map::LoadGrid(float x, float y)
EnsureGridLoaded(Cell(x, y));
}
void Map::LoadAllCells()
{
for (uint32 cellX = 0; cellX < TOTAL_NUMBER_OF_CELLS_PER_MAP; cellX++)
for (uint32 cellY = 0; cellY < TOTAL_NUMBER_OF_CELLS_PER_MAP; cellY++)
LoadGrid((cellX + 0.5f - CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL, (cellY + 0.5f - CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL);
}
bool Map::AddPlayerToMap(Player* player)
{
CellCoord cellCoord = Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY());