From 91a8a7e11d3b82e0fb83ce50a51ee14d55929607 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 22 Nov 2018 15:16:30 +0200 Subject: [PATCH] Fixed DebugConsole selecting non-command lines if up/down is pressed when there are no commands in the console. Closes #927 --- Barotrauma/BarotraumaShared/Source/DebugConsole.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs index 200acdeb0..7caa8a4ef 100644 --- a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs @@ -1895,7 +1895,7 @@ namespace Barotrauma if (++i >= Messages.Count) break; } while (!Messages[selectedIndex].IsCommand); - return Messages[selectedIndex].Text; + return !Messages[selectedIndex].IsCommand ? "" : Messages[selectedIndex].Text; } public static void ExecuteCommand(string command)