Fixed the game running for one more frame after the debugconsole is opened, and staying paused for one extra frame after closing it. Caused the mouselook distance to lerp back from zero after toggling the console.

This commit is contained in:
Joonas Rikkonen
2018-01-29 10:27:43 +02:00
parent 6e231b7e7d
commit 80ce2ae6ae
2 changed files with 2 additions and 1 deletions
@@ -123,7 +123,7 @@ namespace Barotrauma
Vector2 mouseSimPos = ConvertUnits.ToSimUnits(cursorPosition); Vector2 mouseSimPos = ConvertUnits.ToSimUnits(cursorPosition);
if (moveCam) if (moveCam)
{ {
if (DebugConsole.IsOpen || GUI.PauseMenuOpen || DisableControls || if (DebugConsole.IsOpen || GUI.PauseMenuOpen || IsUnconscious ||
(GameMain.GameSession?.CrewManager?.CrewCommander != null && GameMain.GameSession.CrewManager.CrewCommander.IsOpen)) (GameMain.GameSession?.CrewManager?.CrewCommander != null && GameMain.GameSession.CrewManager.CrewCommander.IsOpen))
{ {
if (deltaTime > 0.0f) cam.OffsetAmount = 0.0f; if (deltaTime > 0.0f) cam.OffsetAmount = 0.0f;
@@ -406,6 +406,7 @@ namespace Barotrauma
GUIComponent.UpdateMouseOn(); GUIComponent.UpdateMouseOn();
DebugConsole.Update(this, (float)Timing.Step); DebugConsole.Update(this, (float)Timing.Step);
paused = paused || DebugConsole.IsOpen;
if (!paused) if (!paused)
{ {