diff --git a/Subsurface/Source/DebugConsole.cs b/Subsurface/Source/DebugConsole.cs index 42bfe573e..16083a694 100644 --- a/Subsurface/Source/DebugConsole.cs +++ b/Subsurface/Source/DebugConsole.cs @@ -27,7 +27,7 @@ namespace Barotrauma static class DebugConsole { - const int MaxMessages = 100; + const int MaxMessages = 200; public static List Messages = new List(); @@ -769,6 +769,11 @@ namespace Barotrauma //listbox not created yet, don't attempt to add if (listBox == null) return; + if (listBox.children.Count > MaxMessages) + { + listBox.children.RemoveRange(0, listBox.children.Count - MaxMessages); + } + try { var textBlock = new GUITextBlock(new Rectangle(0, 0, listBox.Rect.Width, 0), msg, GUI.Style, Alignment.TopLeft, Alignment.Left, null, true, GUI.SmallFont);