The initial loading screen is closed if an exception is thrown during loading. Causes the game to crash due to the unloaded content, but that's better than letting the game hang on the loading screen.
This commit is contained in:
@@ -69,6 +69,7 @@ namespace Barotrauma
|
||||
|
||||
public static GameSettings Config;
|
||||
|
||||
private CoroutineHandle loadingCoroutine;
|
||||
private bool hasLoaded;
|
||||
|
||||
private GameTime fixedTime;
|
||||
@@ -203,7 +204,7 @@ namespace Barotrauma
|
||||
loadingScreenOpen = true;
|
||||
TitleScreen = new LoadingScreen(GraphicsDevice);
|
||||
|
||||
CoroutineManager.StartCoroutine(Load());
|
||||
loadingCoroutine = CoroutineManager.StartCoroutine(Load());
|
||||
}
|
||||
|
||||
public IEnumerable<object> Load()
|
||||
@@ -333,6 +334,14 @@ namespace Barotrauma
|
||||
{
|
||||
loadingScreenOpen = false;
|
||||
}
|
||||
|
||||
if (!hasLoaded && !CoroutineManager.IsCoroutineRunning(loadingCoroutine))
|
||||
{
|
||||
DebugConsole.ThrowError("Loading was interrupted due to an error");
|
||||
loadingScreenOpen = false;
|
||||
loadingCoroutine = null;
|
||||
hasLoaded = true;
|
||||
}
|
||||
}
|
||||
else if (hasLoaded)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user