Merge pull request #10440 from peppy/fix-editor-song-after-exit

Fix editor playing deleted beatmap's track on exit-without-save
This commit is contained in:
Dan Balasescu
2020-10-09 17:58:31 +09:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@ -150,7 +150,7 @@ namespace osu.Game.Overlays
{ {
if (IsUserPaused) return; if (IsUserPaused) return;
if (CurrentTrack.IsDummyDevice) if (CurrentTrack.IsDummyDevice || beatmap.Value.BeatmapSetInfo.DeletePending)
{ {
if (beatmap.Disabled) if (beatmap.Disabled)
return; return;

View File

@ -469,10 +469,17 @@ namespace osu.Game.Screens.Edit
private void confirmExit() private void confirmExit()
{ {
// stop the track if playing to allow the parent screen to choose a suitable playback mode.
Beatmap.Value.Track.Stop();
if (isNewBeatmap) if (isNewBeatmap)
{ {
// confirming exit without save means we should delete the new beatmap completely. // confirming exit without save means we should delete the new beatmap completely.
beatmapManager.Delete(playableBeatmap.BeatmapInfo.BeatmapSet); beatmapManager.Delete(playableBeatmap.BeatmapInfo.BeatmapSet);
// in theory this shouldn't be required but due to EF core not sharing instance states 100%
// MusicController is unaware of the changed DeletePending state.
Beatmap.SetDefault();
} }
exitConfirmed = true; exitConfirmed = true;