From 822322e669f4aebc2f588374b6b15aeeb2f917fe Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 4 Jun 2019 15:37:52 +0300 Subject: [PATCH] (bb2624736) Don't keep running the end round cinematic if the player leaves the game screen. Otherwise the player can, for example, quickly start a new single player round or switch to the sub editor, and have the game crash when then end round cinematic finishes and unloads the sub. --- Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs index dc758ab02..b303caea6 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs @@ -1199,7 +1199,7 @@ namespace Barotrauma.Networking { secondsLeft -= CoroutineManager.UnscaledDeltaTime; yield return CoroutineStatus.Running; - } while (secondsLeft > 0.0f); + } while (secondsLeft > 0.0f && Screen.Selected == GameMain.GameScreen); } Submarine.Unload();