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
commit a1226ccaa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

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

View File

@ -469,10 +469,17 @@ namespace osu.Game.Screens.Edit
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)
{
// confirming exit without save means we should delete the new beatmap completely.
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;