From 41a64b1346233bfc418209dc5e6c2d2f80787747 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Wed, 10 Nov 2021 14:56:17 -0600 Subject: [PATCH 1/2] Added a null pointer check to EMFX system component Material editor and other tools load runtime dependencies from game projects. The EMFX system component is checking for game mode by getting a pointer to the editor interface, which will not exist outside of the main O3DE editor. Signed-off-by: Guthrie Adams --- .../Code/Source/Integration/System/SystemComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp index 755db41996..3535bcd942 100644 --- a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp @@ -626,7 +626,7 @@ namespace EMotionFX // Check if we are in game mode. IEditor* editor = nullptr; AzToolsFramework::EditorRequestBus::BroadcastResult(editor, &AzToolsFramework::EditorRequests::GetEditor); - inGameMode = editor->IsInGameMode(); + inGameMode = editor && editor->IsInGameMode(); #endif // Apply the motion extraction deltas to the character controller / entity transform for all entities. From 246f174528ff106f2bb6f32141b96635a71c282b Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Wed, 10 Nov 2021 16:02:12 -0600 Subject: [PATCH 2/2] inverted game mode ptr check Signed-off-by: Guthrie Adams --- .../Code/Source/Integration/System/SystemComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp index 3535bcd942..b7fa03998e 100644 --- a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp @@ -626,7 +626,7 @@ namespace EMotionFX // Check if we are in game mode. IEditor* editor = nullptr; AzToolsFramework::EditorRequestBus::BroadcastResult(editor, &AzToolsFramework::EditorRequests::GetEditor); - inGameMode = editor && editor->IsInGameMode(); + inGameMode = !editor || editor->IsInGameMode(); #endif // Apply the motion extraction deltas to the character controller / entity transform for all entities.