From 6271aaa77ff3beee79c183ecd7baf3bf38544b5b Mon Sep 17 00:00:00 2001 From: daimini Date: Thu, 29 Apr 2021 11:07:15 -0700 Subject: [PATCH] Exclude level container entity from prefab external reference gathering code --- .../UI/Prefab/PrefabIntegrationManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp index 71354b8a1b..7f28080e9e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp @@ -276,6 +276,15 @@ namespace AzToolsFramework QWidget* activeWindow = QApplication::activeWindow(); const AZStd::string prefabFilesPath = "@devassets@/Prefabs"; + // Remove Level entity if it's part of the list + + auto levelContainerIter = + AZStd::find(selectedEntities.begin(), selectedEntities.end(), s_prefabPublicInterface->GetLevelInstanceContainerEntityId()); + if (levelContainerIter != selectedEntities.end()) + { + selectedEntities.erase(levelContainerIter); + } + // Set default folder for prefabs AZ::IO::FileIOBase* fileIoBaseInstance = AZ::IO::FileIOBase::GetInstance();