From c86d650c1a9bc6b051e3d680233d0ad4e488a404 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 20 Aug 2021 19:46:36 -0500 Subject: [PATCH] Updated the CrySystem module to execute deferred console commands (#3371) * Updated the CrySystem module to execute deferred console commands This allows the CVars declared in CrySystem module to execute commands invoked before it was loaded. This is particularly useful for the load level command resolves #2062 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Moved the invocation of deferred console commands after the LevelSystem instance has been created Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Legacy/CrySystem/SystemInit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 08292a6353..b5a6265493 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -1626,6 +1626,9 @@ AZ_POP_DISABLE_WARNING // Send out EBus event EBUS_EVENT(CrySystemEventBus, OnCrySystemInitialized, *this, startupParams); + // Execute any deferred commands that uses the CVar commands that were just registered + AZ::Interface::Get()->ExecuteDeferredConsoleCommands(); + // Verify that the Maestro Gem initialized the movie system correctly. This can be removed if and when Maestro is not a required Gem if (gEnv->IsEditor() && !gEnv->pMovieSystem) { @@ -1641,7 +1644,7 @@ AZ_POP_DISABLE_WARNING m_bInitializedSuccessfully = true; - return (true); + return true; }