fix deprecated call to registry().each()

This commit is contained in:
SweetId 2023-10-11 20:29:01 -04:00
parent 620e4c0f8a
commit 42926a0c9b
1 changed files with 5 additions and 3 deletions

View File

@ -44,8 +44,10 @@ namespace NzEditor
if (!m_currentLevel.IsValid())
return;
m_currentWorld->GetRegistry().each([&](const entt::entity entity) {
entt::handle handle(m_currentWorld->GetRegistry(), entity);
auto& registry = m_currentLevel.GetEnttWorld()->GetRegistry();
for(auto&& entity : registry.storage<entt::entity>().each())
{
entt::handle handle(registry, std::get<entt::entity>(entity));
Nz::NodeComponent* component = handle.try_get<Nz::NodeComponent>();
if (component != nullptr)
{
@ -53,6 +55,6 @@ namespace NzEditor
if (component->GetParent() == nullptr)
m_rootNodes.push_back(component);
}
});
}
}
}