From cf4bbe569be7ef596f447b686c4754c5889f9bfe Mon Sep 17 00:00:00 2001 From: daimini Date: Thu, 22 Apr 2021 09:47:18 -0700 Subject: [PATCH] Remove Prefab cache undo node generation for container entities - will move that work to a separate PR. --- .../Prefab/PrefabPublicHandler.cpp | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index aef757d521..8860d4b155 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -388,24 +388,12 @@ void PrefabPublicHandler::GenerateUndoNodesForEntityChangeAndUpdateCache( if (patch.IsArray() && !patch.Empty() && beforeState.IsObject()) { - if (IsInstanceContainerEntity(entityId) && !IsLevelInstanceContainerEntity(entityId)) - { - // Save these changes as patches to the link - PrefabUndoLinkUpdate* linkUpdate = aznew PrefabUndoLinkUpdate(AZStd::to_string(static_cast(entityId))); - linkUpdate->SetParent(parentUndoBatch); - linkUpdate->Capture(patch, owningInstance->get().GetLinkId()); + // Update the state of the entity + PrefabUndoEntityUpdate* state = aznew PrefabUndoEntityUpdate(AZStd::to_string(static_cast(entityId))); + state->SetParent(parentUndoBatch); + state->Capture(beforeState, afterState, entityId); - linkUpdate->Redo(); - } - else - { - // Update the state of the entity - PrefabUndoEntityUpdate* state = aznew PrefabUndoEntityUpdate(AZStd::to_string(static_cast(entityId))); - state->SetParent(parentUndoBatch); - state->Capture(beforeState, afterState, entityId); - - state->Redo(); - } + state->Redo(); } // Update the cache