Fix song path not escaped while loading.

This commit is contained in:
2023-12-02 17:32:25 +08:00
parent 42c3ed8ca8
commit 290f02cfbc

View File

@@ -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();