Skip to content

Commit

Permalink
#6107: Fix LayerInfoFileModule hierarchy loading code
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Oct 1, 2022
1 parent 08e5830 commit b091ef7
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions radiantcore/layers/LayerInfoFileModule.cpp
Expand Up @@ -294,20 +294,18 @@ void LayerInfoFileModule::applyInfoToScene(const IMapRootNodePtr& root, const ma
{
auto& layerManager = root->getLayerManager();

// Create the layers according to the data found in the map information file
for (const auto& [id, name] : _layerNames)
{
// Create the named layer with the saved ID
// Create the layers according to the data found in the map information file
for (const auto& [id, name] : _layerNames)
{
// Create the named layer with the saved ID
layerManager.createLayer(name, id);
}

// Set parents
auto parentLayer = _layerParentIds.find(id);

if (parentLayer != _layerParentIds.end())
{
layerManager.setParentLayer(id, parentLayer->second);
}
}
// Assigning child and parent layers needs to happen after all layers have been created
for (const auto& [childLayerId, parentLayerId] : _layerParentIds)
{
layerManager.setParentLayer(childLayerId, parentLayerId);
}

// Set the layer mapping iterator to the beginning
auto mapping = _layerMappings.begin();
Expand Down

0 comments on commit b091ef7

Please sign in to comment.