mirror of
https://github.com/ppy/osu
synced 2025-01-04 05:12:10 +00:00
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:
commit
a1226ccaa2
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user