From 7026ad2c15664a9b06b850a2ca85b7775f86e38e Mon Sep 17 00:00:00 2001 From: SnipUndercover Date: Sun, 21 Apr 2024 04:04:08 +0200 Subject: [PATCH] Remove empty entries when splitting .obj lines Some programs would put an additional space after the "v" character, causing ObjModel to crash the entire game when parsing an .obj file. --- Celeste.Mod.mm/Patches/ObjModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Celeste.Mod.mm/Patches/ObjModel.cs b/Celeste.Mod.mm/Patches/ObjModel.cs index d6b9a2ce4..e1c962984 100644 --- a/Celeste.Mod.mm/Patches/ObjModel.cs +++ b/Celeste.Mod.mm/Patches/ObjModel.cs @@ -69,7 +69,7 @@ public static ObjModel CreateFromStream(Stream stream, string fname) { using (StreamReader streamReader = new StreamReader(stream)) { string text; while ((text = streamReader.ReadLine()) != null) { - string[] array = text.Split(' '); + string[] array = text.Split(' ', StringSplitOptions.RemoveEmptyEntries); if (array.Length != 0) { string a = array[0]; if (a == "o") {