From 1f8460e8ad02ca7e2a52f54ec15ce27789b99a71 Mon Sep 17 00:00:00 2001 From: Regalis Date: Sat, 3 Jun 2017 18:21:56 +0300 Subject: [PATCH] GameMain throws an exception immediately if loading the game fails (instead of closing the loading screen and waiting for the inevitable crash) --- Subsurface/Source/GameMain.cs | 13 +++++-------- .../Source/Items/Components/Machines/Reactor.cs | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs index 4415a7629..9b3759882 100644 --- a/Subsurface/Source/GameMain.cs +++ b/Subsurface/Source/GameMain.cs @@ -181,16 +181,16 @@ namespace Barotrauma ConvertUnits.SetDisplayUnitToSimUnitRatio(Physics.DisplayToSimRation); - spriteBatch = new SpriteBatch(base.GraphicsDevice); - TextureLoader.Init(base.GraphicsDevice); + spriteBatch = new SpriteBatch(GraphicsDevice); + TextureLoader.Init(GraphicsDevice); loadingScreenOpen = true; - TitleScreen = new LoadingScreen(base.GraphicsDevice); + TitleScreen = new LoadingScreen(GraphicsDevice); loadingCoroutine = CoroutineManager.StartCoroutine(Load()); } - public IEnumerable Load() + private IEnumerable Load() { GUI.GraphicsDevice = base.GraphicsDevice; GUI.Init(Content); @@ -320,10 +320,7 @@ namespace Barotrauma if (!hasLoaded && !CoroutineManager.IsCoroutineRunning(loadingCoroutine)) { - DebugConsole.ThrowError("Loading was interrupted due to an error"); - loadingScreenOpen = false; - loadingCoroutine = null; - hasLoaded = true; + throw new Exception("Loading was interrupted due to an error"); } } else if (hasLoaded) diff --git a/Subsurface/Source/Items/Components/Machines/Reactor.cs b/Subsurface/Source/Items/Components/Machines/Reactor.cs index 68e544d8a..ed7ecb063 100644 --- a/Subsurface/Source/Items/Components/Machines/Reactor.cs +++ b/Subsurface/Source/Items/Components/Machines/Reactor.cs @@ -263,7 +263,7 @@ namespace Barotrauma.Items.Components ", Cooling rate: " + (int)coolingRate + ", Cooling rate: " + coolingRate + ", Shutdown temp: " + shutDownTemp + - (autoTemp ? "Autotemp ON" : "Autotemp OFF"), + (autoTemp ? ", Autotemp ON" : ", Autotemp OFF"), ServerLog.MessageType.ItemInteraction); nextServerLogWriteTime = null;