GameMain throws an exception immediately if loading the game fails (instead of closing the loading screen and waiting for the inevitable crash)

This commit is contained in:
Regalis
2017-06-03 18:21:56 +03:00
parent f5d8669da3
commit 1f8460e8ad
2 changed files with 6 additions and 9 deletions

View File

@@ -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<object> Load()
private IEnumerable<object> 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)

View File

@@ -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;