From 290f02cfbcb741d55cd1602856958cc108657622 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Sat, 2 Dec 2023 17:32:25 +0800 Subject: [PATCH] Fix song path not escaped while loading. --- Assets/Cryville/Crtr/Event/ChartHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Cryville/Crtr/Event/ChartHandler.cs b/Assets/Cryville/Crtr/Event/ChartHandler.cs index 0501917..9d3808b 100644 --- a/Assets/Cryville/Crtr/Event/ChartHandler.cs +++ b/Assets/Cryville/Crtr/Event/ChartHandler.cs @@ -1,4 +1,5 @@ using Cryville.Audio.Source.Libav; +using Cryville.Common; using System.Collections.Generic; using System.IO; @@ -26,7 +27,7 @@ namespace Cryville.Crtr.Event { else if (ev.Unstamped == null) { } else if (ev.Unstamped is Chart.Sound) { Chart.Sound tev = (Chart.Sound)ev.Unstamped; - var dir = new DirectoryInfo(Path.Combine(Game.GameDataPath, "songs", tev.id)); + var dir = new DirectoryInfo(Path.Combine(Game.GameDataPath, "songs", StringUtils.EscapeFileName(tev.id))); var files = dir.GetFiles(); var source = new LibavFileAudioSource(files[0].FullName); source.SelectStream();