Repository: movingblocks/terasology
Issue: Null pointer exception when trying to use load latest.

<!-- Thanks for taking the time to submit a thorough issue report for Terasology! :-)
Please fill out whichever details below seem relevant to your issue.
Note that suggestions, general questions & support should go in the forum:
* http://forum.terasology.org/forum/suggestions.21
* http://forum.terasology.org/forum/support.20/
Bug reports and crashes likely resulting from bugs in the engine go here on GitHub. -->

### What you were trying to do
Use the load latest configuration. 
### What actually happened
Null pointer exception in the Terasology java class
### How to reproduce

* Step 1
Try to use the load latest configuration.
* Step 2
Crash...

### Log details and game version
I think 3.2.0
### Computer details
i7 7700k
GTX 2080ti
16GB Ram
NVMe 128gb SSD


Changed files:
facades/PC/src/main/java/org/terasology/engine/Terasology.java, engine/src/main/java/org/terasology/engine/TerasologyEngine.java

diff --git a/engine/src/main/java/org/terasology/engine/TerasologyEngine.java b/engine/src/main/java/org/terasology/engine/TerasologyEngine.java
index 209e1fb95..3ece241eb 100644
--- a/engine/src/main/java/org/terasology/engine/TerasologyEngine.java
+++ b/engine/src/main/java/org/terasology/engine/TerasologyEngine.java
@@ -137,6 +137,7 @@ public class TerasologyEngine implements GameEngine {
     private TimeSubsystem timeSubsystem;
     private Deque<EngineSubsystem> allSubsystems;
     private ModuleAwareAssetTypeManager assetTypeManager;
+    private boolean initialisedAlready;
 
     /**
      * Contains objects that live for the duration of this engine.
@@ -201,40 +202,43 @@ protected void addToClassesOnClasspathsToAddToEngine(Class<?> clazz) {
     public void initialize() {
         Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
         Stopwatch totalInitTime = Stopwatch.createStarted();
-        try {
-            logger.info("Initializing Terasology...");
-            logEnvironmentInfo();
+        if (!initialisedAlready) {
+            try {
+                logger.info("Initializing Terasology...");
+                logEnvironmentInfo();
 
-            // TODO: Need to get everything thread safe and get rid of the concept of "GameThread" as much as possible.
-            GameThread.setToCurrentThread();
+                // TODO: Need to get everything thread safe and get rid of the concept of "GameThread" as much as possible.
+                GameThread.setToCurrentThread();
 
-            preInitSubsystems();
+                preInitSubsystems();
 
-            initManagers();
+                initManagers();
 
-            initSubsystems();
+                initSubsystems();
 
-            changeStatus(TerasologyEngineStatus.INITIALIZING_ASSET_MANAGEMENT);
-            initAssets();
+                changeStatus(TerasologyEngineStatus.INITIALIZING_ASSET_MANAGEMENT);
+                initAssets();
 
-            EnvironmentSwitchHandler environmentSwitcher = new EnvironmentSwitchHandler();
-            rootContext.put(EnvironmentSwitchHandler.class, environmentSwitcher);
+                EnvironmentSwitchHandler environmentSwitcher = new EnvironmentSwitchHandler();
+                rootContext.put(EnvironmentSwitchHandler.class, environmentSwitcher);
 
-            environmentSwitcher.handleSwitchToGameEnvironment(rootContext);
+                environmentSwitcher.handleSwitchToGameEnvironment(rootContext);
 
-            postInitSubsystems();
+                postInitSubsystems();
 
-            verifyInitialisation();
+                verifyInitialisation();
 
-            /*
-             * Prevent objects being put in engine context after init phase. Engine states should use/create a
-             * child context.
-             */
-            CoreRegistry.setContext(null);
-        } catch (RuntimeException e) {
-            logger.error("Failed to initialise Terasology", e);
-            cleanup();
-            throw e;
+                /*
+                 * Prevent objects being put in engine context after init phase. Engine states should use/create a
+                 * child context.
+                 */
+                CoreRegistry.setContext(null);
+                initialisedAlready = true;
+            } catch (RuntimeException e) {
+                logger.error("Failed to initialise Terasology", e);
+                cleanup();
+                throw e;
+            }
         }
 
         double seconds = 0.001 * totalInitTime.elapsed(TimeUnit.MILLISECONDS);
diff --git a/facades/PC/src/main/java/org/terasology/engine/Terasology.java b/facades/PC/src/main/java/org/terasology/engine/Terasology.java
index 9887c9417..bac293d19 100644
--- a/facades/PC/src/main/java/org/terasology/engine/Terasology.java
+++ b/facades/PC/src/main/java/org/terasology/engine/Terasology.java
@@ -152,6 +152,7 @@ public static void main(String[] args) {
                 engine.run(new StateHeadlessSetup());
             } else {
                 if (loadLastGame) {
+                    engine.initialize(); //initialize the managers first
                     engine.getFromEngineContext(ThreadManager.class).submitTask("loadGame", () -> {
                         GameManifest gameManifest = getLatestGameManifest();
                         if (gameManifest != null) {