mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/Maps: make sure that the grid of the terrain map's parent is loaded when entering terrainswaped zones. This fixes loading vmaps and mmaps for terrain swapped maps
This commit is contained in:
@@ -2430,8 +2430,12 @@ GridMap* Map::GetGrid(uint32 mapId, float x, float y)
|
||||
GridMap* grid = GridMaps[gx][gy];
|
||||
|
||||
auto childMapItr = std::find_if(m_childTerrainMaps->begin(), m_childTerrainMaps->end(), [mapId](Map* childTerrainMap) { return childTerrainMap->GetId() == mapId; });
|
||||
if (childMapItr != m_childTerrainMaps->end() && (*childMapItr)->GridMaps[gx][gy] && (*childMapItr)->GridMaps[gx][gy]->fileExists())
|
||||
grid = (*childMapItr)->GridMaps[gx][gy];
|
||||
if (childMapItr != m_childTerrainMaps->end())
|
||||
{
|
||||
(*childMapItr)->EnsureGridCreated(GridCoord((MAX_NUMBER_OF_GRIDS - 1) - gx, (MAX_NUMBER_OF_GRIDS - 1) - gy));
|
||||
if ((*childMapItr)->GridMaps[gx][gy]->fileExists())
|
||||
grid = (*childMapItr)->GridMaps[gx][gy];
|
||||
}
|
||||
|
||||
return grid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user