diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index d9cfe3f340..c308a73874 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -504,7 +504,7 @@ namespace AzToolsFramework copy.CopyFrom(templateReference->get().GetPrefabDom(), copy.GetAllocator(), false); context.AddPrefab(DefaultMainSpawnableName, AZStd::move(copy)); m_playInEditorData.m_converter.ProcessPrefab(context); - if (context.HasCompletedSuccessfully()) + if (context.HasCompletedSuccessfully() && !context.GetProcessedObjects().empty()) { static constexpr size_t NoRootSpawnable = AZStd::numeric_limits::max(); size_t rootSpawnableIndex = NoRootSpawnable; @@ -551,6 +551,13 @@ namespace AzToolsFramework m_playInEditorData.m_entities.Reset(m_playInEditorData.m_assets[rootSpawnableIndex]); m_playInEditorData.m_entities.SpawnAllEntities(); } + else + { + AZ_Error("Prefab", false, + "Processing of the level prefab failed to produce a root spawnable while entering game mode. " + "Unable to fully enter game mode."); + return; + } // This is a workaround until the replacement for GameEntityContext is done AzFramework::GameEntityContextEventBus::Broadcast( @@ -558,7 +565,9 @@ namespace AzToolsFramework } else { - AZ_Error("Prefab", false, "Failed to convert the prefab into assets."); + AZ_Error("Prefab", false, + "Failed to convert the prefab into assets. " + "Confirm that the 'PlayInEditor' prefab processor stack is capable of producing a useable product asset."); return; } } @@ -596,6 +605,10 @@ namespace AzToolsFramework } m_playInEditorData.m_deactivatedEntities.clear(); + AZ_Assert(m_playInEditorData.m_entities.IsSet(), + "Invalid Game Mode Entities Container encountered after play-in-editor stopped. " + "Confirm that the container was initialized correctly"); + m_playInEditorData.m_entities.DespawnAllEntities(); m_playInEditorData.m_entities.Alert( [assets = AZStd::move(m_playInEditorData.m_assets)]([[maybe_unused]]uint32_t generation) mutable diff --git a/Gems/Multiplayer/Code/CMakeLists.txt b/Gems/Multiplayer/Code/CMakeLists.txt index 4d9635f3b5..42de715cd2 100644 --- a/Gems/Multiplayer/Code/CMakeLists.txt +++ b/Gems/Multiplayer/Code/CMakeLists.txt @@ -151,7 +151,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) ) # use the Multiplayer.Editor module in tools like the Editor: Such tools also get the visual debug view: - ly_create_alias(NAME Multiplayer.Tools NAMESPACE Gem TARGETS Gem::Multiplayer.Editor Gem::Multiplayer.Debug) + ly_create_alias(NAME Multiplayer.Tools NAMESPACE Gem TARGETS Gem::Multiplayer.Editor Gem::Multiplayer.Debug Gem::Multiplayer.Builders) endif() if (PAL_TRAIT_BUILD_TESTS_SUPPORTED)