Fix applying prefab changes to nesting prefab instances

#1256
This commit is contained in:
Wojtek Figat
2023-09-10 21:07:41 +02:00
parent ae27d51dc6
commit 716e643f2a
4 changed files with 5 additions and 11 deletions

View File

@@ -1255,20 +1255,19 @@ void Prefab::SyncNestedPrefabs(const NestedPrefabsList& allPrefabs, Array<Prefab
auto nestedPrefab = allPrefabs[i].Get();
if (nestedPrefab)
{
if (WaitForLoaded())
if (nestedPrefab->WaitForLoaded())
{
LOG(Warning, "Waiting for prefab asset load failed.");
continue;
}
// Sync only if prefab is used by this prefab (directly) and it has been captured before
const int32 nestedPrefabIndex = nestedPrefab->NestedPrefabs.Find(GetID());
if (nestedPrefabIndex != -1)
{
if (nestedPrefab->SyncChangesInternal(allPrefabsInstancesData[nestedPrefabIndex]))
if (nestedPrefab->SyncChangesInternal(allPrefabsInstancesData[i]))
continue;
nestedPrefab->SyncNestedPrefabs(allPrefabs, allPrefabsInstancesData);
ObjectsRemovalService::Flush();
}
}