Core/Maps: Ensure all child terrain maps are created before doing anything on parent map such as loading respawn times and corpses

This commit is contained in:
Shauren
2019-04-06 11:13:34 +02:00
parent 4ddaa6cf69
commit f729050900

View File

@@ -102,17 +102,19 @@ Map* MapManager::CreateBaseMap_i(MapEntry const* mapEntry)
if (mapEntry->Instanceable())
map = new MapInstanced(mapEntry->ID, i_gridCleanUpDelay);
else
{
map = new Map(mapEntry->ID, i_gridCleanUpDelay, 0, DIFFICULTY_NONE);
map->LoadRespawnTimes();
map->LoadCorpseData();
}
i_maps[mapEntry->ID] = map;
for (uint32 childMapId : _parentMapData[mapEntry->ID])
map->AddChildTerrainMap(CreateBaseMap_i(sMapStore.AssertEntry(childMapId)));
if (!mapEntry->Instanceable())
{
map->LoadRespawnTimes();
map->LoadCorpseData();
}
return map;
}