diff --git a/Celeste.Mod.mm/Patches/Monocle/Commands.cs b/Celeste.Mod.mm/Patches/Monocle/Commands.cs index 514c51203..fc8cb6988 100644 --- a/Celeste.Mod.mm/Patches/Monocle/Commands.cs +++ b/Celeste.Mod.mm/Patches/Monocle/Commands.cs @@ -436,6 +436,7 @@ public void ReloadCommandsList() { } drawCommands.Insert(0, new patch_Line(text, color)); int maxCommandLines = Math.Max(CoreModule.Settings.ExtraCommandHistoryLines + (Engine.Instance.Window.ClientBounds.Height - 100) / 30, 0); + firstLineIndexToDraw = Calc.Clamp(firstLineIndexToDraw, 0, Math.Max(drawCommands.Count - 1, 0)); while (drawCommands.Count > maxCommandLines) { drawCommands.RemoveAt(drawCommands.Count - 1); }