if not storyboard file

This commit is contained in:
james58899 2018-01-11 13:53:41 +08:00
parent fbffc8bb89
commit 4fa038aa27
No known key found for this signature in database
GPG Key ID: 7F83E3A11DD5192E

View File

@ -691,14 +691,19 @@ namespace osu.Game.Beatmaps
protected override Storyboard GetStoryboard() protected override Storyboard GetStoryboard()
{ {
if (BeatmapInfo?.Path == null && BeatmapSetInfo?.StoryboardFile == null)
return new Storyboard();
try try
{ {
using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo?.Path))))
using (var storyboard = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile)))) using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo.Path))))
return Decoder.GetDecoder(beatmap).GetStoryboardDecoder().DecodeStoryboard(beatmap, storyboard); {
Decoder decoder = Decoder.GetDecoder(beatmap);
if (BeatmapSetInfo?.StoryboardFile == null)
return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap);
using (var storyboard = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile))))
return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap, storyboard);
}
} }
catch catch
{ {