Core/Spells: restore the pointer check for grid maps to make sure that we will never see a nullpointer ever again
This commit is contained in:
1 parent
1063584cce
commit
431e6027c6
1 file changed
+1
-1
@@ -2430,7 +2430,7 @@ 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]->fileExists())
|
||||
if (childMapItr != m_childTerrainMaps->end() && (*childMapItr)->GridMaps[gx][gy] && (*childMapItr)->GridMaps[gx][gy]->fileExists())
|
||||
grid = (*childMapItr)->GridMaps[gx][gy];
|
||||
|
||||
return grid;
|
||||
|
||||
Reference in new issue
Block a user