From ef4752eb6265159264f33a29fdfa8db23c31b032 Mon Sep 17 00:00:00 2001 From: Super Balls Date: Mon, 29 Jan 2024 02:14:45 -0800 Subject: [PATCH] Fixed PEBKAC compatibility error where the game would crash if a channel that does not exist is used. --- BmsLoader.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BmsLoader.cs b/BmsLoader.cs index 04d7fd8..5189d98 100644 --- a/BmsLoader.cs +++ b/BmsLoader.cs @@ -85,6 +85,9 @@ internal static Bms Load(MemoryStream stream, string bmsName) var beat = int.Parse(key[..3], CultureInfo.InvariantCulture); var typeCode = key.Substring(3, 2); + + if (!Bms.Channels.ContainsKey(typeCode)) continue; + var type = Bms.Channels[typeCode]; if (type == Bms.ChannelType.SpTimesig)