Make maps with storyboards decode correctly with OsuJsonDecoder

This commit is contained in:
smoogipoo 2017-12-07 10:37:51 +09:00
parent a8db3a9484
commit 0e3b001b13

View File

@ -18,8 +18,16 @@ namespace osu.Game.Beatmaps.Formats
stream.BaseStream.Position = 0; stream.BaseStream.Position = 0;
stream.DiscardBufferedData(); stream.DiscardBufferedData();
string fullText = stream.ReadToEnd(); try
fullText.DeserializeInto(beatmap); {
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) foreach (var hitObject in beatmap.HitObjects)
hitObject.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty); hitObject.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty);