From 0e3b001b133e310064065be3c98f3f13f320321d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 7 Dec 2017 10:37:51 +0900 Subject: [PATCH] Make maps with storyboards decode correctly with OsuJsonDecoder --- osu.Game/Beatmaps/Formats/OsuJsonDecoder.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuJsonDecoder.cs b/osu.Game/Beatmaps/Formats/OsuJsonDecoder.cs index ed4b8f3857..d00cbbb8fb 100644 --- a/osu.Game/Beatmaps/Formats/OsuJsonDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuJsonDecoder.cs @@ -18,8 +18,16 @@ namespace osu.Game.Beatmaps.Formats stream.BaseStream.Position = 0; stream.DiscardBufferedData(); - string fullText = stream.ReadToEnd(); - fullText.DeserializeInto(beatmap); + try + { + string fullText = stream.ReadToEnd(); + fullText.DeserializeInto(beatmap); + } + catch + { + // Temporary because storyboards are deserialized into beatmaps at the moment + // This try-catch shouldn't exist in the future + } foreach (var hitObject in beatmap.HitObjects) hitObject.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty);