Fixed a bug that would shift the remapping of prefab skeleton by 1 depth

This commit is contained in:
Antoine Pilote
2024-04-23 23:38:34 -04:00
parent 39025d8b06
commit 4468b83364

View File

@@ -92,7 +92,6 @@ namespace Nuake {
const auto& scene = Engine::GetCurrentScene();
std::map<uint32_t, uint32_t> newIdsLut;
for (json e : j["Entities"])
{
Entity entity = { scene->m_Registry.create(), scene.get() };
@@ -140,9 +139,9 @@ namespace Nuake {
// reparenting. Pretty neat.
std::function<void(SkeletonNode&)> recursiveBoneRemapping = [&recursiveBoneRemapping, &newIdsLut](SkeletonNode& currentBone)
{
currentBone.EntityHandle = newIdsLut[currentBone.EntityHandle];
for (SkeletonNode& bone : currentBone.Children)
{
bone.EntityHandle = newIdsLut[bone.EntityHandle];
recursiveBoneRemapping(bone);
}
};