Merge pull request #8913 from smoogipoo/fix-mania-undo-redo-crash

Fix mania crashing on undo/redo
This commit is contained in:
Dean Herbert 2020-04-30 21:03:38 +09:00 committed by GitHub
commit 53474c74ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,11 @@ namespace osu.Game.Screens.Edit
{
using (var stream = new MemoryStream(state))
using (var reader = new LineBufferedReader(stream, true))
return new PassThroughWorkingBeatmap(Decoder.GetDecoder<Beatmap>(reader).Decode(reader)).GetPlayableBeatmap(editorBeatmap.BeatmapInfo.Ruleset);
{
var decoded = Decoder.GetDecoder<Beatmap>(reader).Decode(reader);
decoded.BeatmapInfo.Ruleset = editorBeatmap.BeatmapInfo.Ruleset;
return new PassThroughWorkingBeatmap(decoded).GetPlayableBeatmap(editorBeatmap.BeatmapInfo.Ruleset);
}
}
private class PassThroughWorkingBeatmap : WorkingBeatmap